Advertisement
Guest User

Untitled

a guest
Jan 28th, 2015
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. git()
  2. {
  3.   if [[ $1 == "merge" ]] || [[ $1 == "rebase" ]] || [[ $1 == "pull" ]]; then
  4.     command git "$@"
  5.     rc=$?
  6.     if [[ $rc == 1 ]]; then
  7.       echo "There are conflicts, better run git-mergetool!!!"
  8.       # There might be some other condition that returns a '1',
  9.       # if so you can add another check like this:
  10.       # if grep Conflicts $(git --git-dir)/MERGE_MSG;
  11.       FILE="MERGETOOL"
  12.       if [ -f $FILE ]; then
  13.           command git mergetool
  14.       fi
  15.     fi
  16.   else
  17.     command git "$@"
  18.   fi
  19. }
  20. ub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement