Last active
August 4, 2016 19:01
-
-
Save kristopherjohnson/b72241f81bf04aeea512c7917c9725a7 to your computer and use it in GitHub Desktop.
bash/zsh function for pushing a new git branch to remote
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
| # Get the current git branch name | |
| git-branch-name() { | |
| git symbolic-ref --short HEAD | |
| } | |
| # Push new branch to origin and set up tracking | |
| git-push-new-branch() { | |
| git push -u origin $(git-branch-name) | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Typical use: