Skip to content

Instantly share code, notes, and snippets.

@bgadrian
Created March 16, 2015 16:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bgadrian/358615eb1c83963edaed to your computer and use it in GitHub Desktop.
Save bgadrian/358615eb1c83963edaed to your computer and use it in GitHub Desktop.
Git aliases
//a collection of git aliases
//to have them on all projects on my user
//vim ~/.gitconfig
[alias]
cp = cherry-pick
st = status -s
ci = commit
br = branch
co = checkout
df = diff --wrod-diff
lg = log -pm
sl = stash list
sa = stash apply
ss = stash save
lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'
pus = "!git push origin \"$(git rev-parse --abbrev-ref HEAD)\""
pul = "!git pull origin \"$(git rev-parse --abbrev-ref HEAD)\""
conflicts = !git ls-files --unmerged | cut -f2 | sort -u
count-conflicts = !grep -c '^=======$'
count-all-conflicts = !grep -c '^=======$' $(git conflicts)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment