Skip to content

Instantly share code, notes, and snippets.

@monking
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monking/33891f07f079dcd2489a to your computer and use it in GitHub Desktop.
Save monking/33891f07f079dcd2489a to your computer and use it in GitHub Desktop.
Git aliases, and Bash aliases for Git
# go to git root
alias gu='cd $(git rev-parse --show-cdup)'
[alias]
co = checkout
s = status
r = rebase
f = fetch
l = log
md = branch -a --merged
si = submodule update --init
mt = mergetool
# show all commits not shared between two branches
# usage: git ld leftbranch...rightbranch
ld = log --cherry-pick --oneline --left-right
# open all conflicting files in Vim, searching for conflicts
vc = !vim +'/^[<=>]\\{7}' $(git status | grep 'both \\(modified\\|added\\):' | perl -pe 's/^.*both (modified|added):\\s+(.*)$/$2/')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment