Created
March 25, 2012 21:49
-
-
Save mwitek/2200122 to your computer and use it in GitHub Desktop.
Git push origin [branch_name] alias command
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
## Copy code below into .bash_profile | |
#alias commands for git push origin [your current branch] & git pull origin [your current branch] | |
alias gpush='git push origin $(git_current_branch)' | |
alias gpull='git pull origin $(git_current_branch)' | |
#function that retrieves the current branch name | |
git_current_branch() { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment