My Two Favorite Git Aliases →

Definitely handy – I’ve added them to my .gitconfig. (note the double-encoded ampersands should simply be & instead of &)

UPDATE: Here is a Gist with some of my favorite alises – including incoming and outgoing that will use the currently checked out branch against the matching origin branch (no longer hard coded to master):


[alias]
up = "pull –rebase"
pullmerge = "pull –no-rebase"
subup = "!f() { git submodule sync; git submodule update –init –recursive; }; f"
subreset = "submodule foreach 'git reset –hard HEAD'"
who = shortlog -s —
lg = log –graph –pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' –abbrev-commit –date=relative
info = remote -v
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}..)

view raw

.gitconfig

hosted with ❤ by GitHub

This post is part of the thread: Version Control – an ongoing story on this site. View the thread timeline for more context on this post.