Skip to content

Instantly share code, notes, and snippets.

@thadeu
Created April 8, 2020 15:26
Show Gist options
  • Save thadeu/854cf2cccd17e299baa9b5dc094af2c4 to your computer and use it in GitHub Desktop.
Save thadeu/854cf2cccd17e299baa9b5dc094af2c4 to your computer and use it in GitHub Desktop.
Alias to .gitconfig
[alias]
psh = push origin HEAD
cm = checkout master
co = checkout
cb = checkout -b
amend = commit -a --amend
ahead = "!sh -c 'echo branch is $(git fetch origin --quiet && git rev-list --count origin/master..HEAD) commits ahead, $(git fetch origin --quiet && git rev-list --count HEAD..origin/master) commits behind master'"
ci = commit
st = status -sb
sf = show --name-only
lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u})
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..)
unstage = reset HEAD --
undo = checkout --
rollback = reset --soft HEAD~1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment