Created
April 24, 2014 08:59
-
-
Save DennisOSRM/11247276 to your computer and use it in GitHub Desktop.
bashrc bit to start mergetool on conflict automatically
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
git() | |
{ | |
if [[ $1 == "merge" ]] || [[ $1 == "rebase" ]] || [[ $1 == "pull" ]]; then | |
command git "$@" | |
rc=$? | |
if [[ $rc == 1 ]]; then | |
echo "There are conflicts, better run git-mergetool!!!" | |
# There might be some other condition that returns a '1', | |
# if so you can add another check like this: | |
# if grep Conflicts $(git --git-dir)/MERGE_MSG; | |
command git mergetool | |
fi | |
else | |
command git "$@" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment