Created
January 26, 2018 23:21
-
-
Save aaronlelevier/764edc22eeb3a7a00de41ddb2860a564 to your computer and use it in GitHub Desktop.
Rebases the master branch and pushes up local synced 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
| pullandpush () { | |
| if [ $# -eq 0 ] | |
| then | |
| echo "branch name not specified" | |
| else | |
| branch=$1 | |
| git checkout master | |
| git pull --rebase | |
| git checkout $branch | |
| git rebase origin/master | |
| git push -u origin --force-with-lease $branch | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment