Skip to content

Instantly share code, notes, and snippets.

@jcartledge
Created December 4, 2012 10:26
Show Gist options
  • Save jcartledge/4202471 to your computer and use it in GitHub Desktop.
Save jcartledge/4202471 to your computer and use it in GitHub Desktop.
git fix alias to help resolving merge/rebase conflicts: opens all unmerged files in sublimetext

This one-liner will create a git fix alias in your ~/.gitconfig file.

When a git merge or rebase fails with conflicts, git fix will open all the unmerged files in sublimetext.

Change subl -nw to $EDITOR or whatever you prefer if you don't use sublimetext.

git config --global alias.fix '!git status -s|grep "^U"|cut -d " " -f 2|xargs subl -nw'
@jcartledge
Copy link
Author

Needs work - doesn't identify cases like AA, AD, DA etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment