lluis lluis - 12 days ago 7
Git Question

git: can I accept both changes in a merge conflict without editing files?

I usually have merge conflicts on Rails locale files, for example:

<<<<<<< HEAD
label_company_offices: "Branches"
=======
field_amounts_withheld: "Withheld amount"
>>>>>>> master


here I have to edit every locale file, can I avoid this?

there's any way to tell git "resolve conflict accepting both changes"?

Answer

this does the job for me:

ruby -pi -e "gsub(/^[=<>*]{7}.*\n/,'')" config/locales/*.yml
Comments