Skip to content

Instantly share code, notes, and snippets.

@aviemzur
Last active August 6, 2019 12:36
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 aviemzur/94f24a17b41af7f9533e58d4709fa298 to your computer and use it in GitHub Desktop.
Save aviemzur/94f24a17b41af7f9533e58d4709fa298 to your computer and use it in GitHub Desktop.
Git aliases
[alias] update = "!git checkout master && git pull && git checkout -"
[alias] push-new = "!git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)"
[alias] push-aviemzur-new = "!git push --set-upstream aviemzur $(git rev-parse --abbrev-ref HEAD)"
[alias] close = "!f() { git checkout master && git merge --no-ff -m \"This closes #$1\" pr/$1; }; f"
[alias] pr = "!f() { git checkout master && git fetch origin && git branch -D pr/$1 || : && git checkout pr/$1; }; f"
[alias] review = "!f() { git branch -D review-before || : && git checkout $1 -b review-before && git checkout -; }; f"
[alias] fresh = "!f() { git branch | grep -v master | xargs git branch -D; }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment