Created
November 19, 2013 01:40
-
-
Save wfarr/7538767 to your computer and use it in GitHub Desktop.
Handy git aliases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
up = "!sh -c 'git fetch origin; if ! git diff --exit-code origin/$(git rev-parse --abbrev-ref HEAD) >/dev/null || ! git diff --exit-code HEAD...origin/master >/dev/null; then git rebase origin/$(git rev-parse --abbrev-ref HEAD) && git merge --no-edit origin/master && git log --pretty=format:\"%Cred%ae %Creset- %C(yellow)%s %Creset(%ar)\" HEAD@{1}..; else echo \"$(git rev-parse --abbrev-ref HEAD) already up-to-date\"; fi'" | |
go = "!sh -c 'if git rev-parse --abbrev-ref $1 >/dev/null 2>/dev/null; then git checkout $1; else git checkout -t -b $1; fi' -" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment