Last active
October 23, 2016 19:47
-
-
Save iegik/2451f620330cfe5ca949 to your computer and use it in GitHub Desktop.
Git tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| splitdiff() { sed '/<<<<<<</,/=======/d;/>>>>>>>/d' $1 > $1.REMOTE; sed '/<<<<<<</d;/=======/,/>>>>>>>/d' $1 > $1.LOCAL; echo $1; } | |
| automerge() { mv $1 $1.BASE;git checkout BASE $1; meld --auto-merge $1.LOCAL $1 $1.REMOTE; echo $1; } | |
| closemerge() { git add $1; rm $1.BASE $1.LOCAL $1.REMOTE; echo $1; } | |
| mergetool() { splitdiff $1 && automerge $1 && closemerge $1; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Split Git CONFLICT files into LOCAL and REMOTE | |
| # After that You can use your preffered diff tool to resolve conflict | |
| sed '/<<<<<<</,/=======/d;/>>>>>>>/d' $1 > $1.REMOTE | |
| sed '/<<<<<<</d;/=======/,/>>>>>>>/d' $1 > $1.LOCAL |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bash:
splitdiff() { sed '/<<<<<<</,/=======/d;/>>>>>>>/d' $1 > $1.REMOTE; sed '/<<<<<<</d;/=======/,/>>>>>>>/d' $1 > $1.LOCAL; }