Skip to content

Instantly share code, notes, and snippets.

@lukzgois
Last active July 28, 2016 20:57
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 lukzgois/7744b7e1e60f770dbb150ba871144d40 to your computer and use it in GitHub Desktop.
Save lukzgois/7744b7e1e60f770dbb150ba871144d40 to your computer and use it in GitHub Desktop.
Some git alias for my projects
[alias]
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = !git rev-parse --abbrev-ref HEAD
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = !git push -u origin $(git branch-name)
force-publish = !git push -u -f origin $(git branch-name)
# Create new branches
new-feature = "!f() { git checkout -b feature/$1; }; f" # Create a new feature branch
new-hotfix = "!f() { git checkout -b hotfix/$1; }; f" # Create a new hotfix branch
new-release = "!f() { git checkout -b release/$1; }; f" # Create a new release branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment