lluis lluis - 1 year ago 110
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 Source

this does the job for me:

ruby -pi -e "gsub(/^[=<>*]{7}.*\n/,'')" config/locales/*.yml
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download