0

Was trying to merge new commits from opensource and faced conflicts. git introduced "<<<<<<< HEAD" and "=======" Thought of checking for any shell script to reduce the burden?

Samira Khorshidi
  • 963
  • 1
  • 9
  • 29
  • Hope this piece of code helps...grep -rl "<<<<<<< HEAD" test/ | xargs sed -i "/<<<<<<< HEAD/,/=======/d" grep -rl ">>>>>>> " test/ | xargs sed -i "/>>>>>>> /d" optmized version: cd test git ls-files -u | cut -f 2 | sort -u | xargs sed -i "/<<<<<<< HEAD/,/=======/d" git ls-files -u | cut -f 2 | sort -u | xargs sed -i "/>>>>>>> /d" – PrakashPedarla Jan 09 '14 at 06:07

1 Answers1

1

You would reduce the burden through a mergetool, which would present you all the files with conflicts to resolve.

See for instance "Merging With a GUI" and "Merging with “git mergetool”"

git mergetool -t kdiff3

http://www.gitguys.com/gitguys/merging/images/kdiff3.png

That way, the GUI merge tool take care of those merge markers for you.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250