Last active
July 28, 2016 20:57
-
-
Save lukzgois/7744b7e1e60f770dbb150ba871144d40 to your computer and use it in GitHub Desktop.
Some git alias for my projects
This file contains hidden or 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] | |
# 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