Skip to content

Instantly share code, notes, and snippets.

@aaronlelevier
Created January 26, 2018 23:21
Show Gist options
  • Select an option

  • Save aaronlelevier/764edc22eeb3a7a00de41ddb2860a564 to your computer and use it in GitHub Desktop.

Select an option

Save aaronlelevier/764edc22eeb3a7a00de41ddb2860a564 to your computer and use it in GitHub Desktop.
Rebases the master branch and pushes up local synced branch to remote
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