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?
Asked
Active
Viewed 706 times
0
-
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 Answers
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
That way, the GUI merge tool take care of those merge markers for you.