Bash script to rebase local git branch with local master
pullmaster [branch]
branch
- optional custom branch name to rebase from. Default: master
When you are going to work with several features and have only one git branch (like in case with Gerrit), it is pretty convenient to have set of local development branches to switch between code revisions. Then you have to keep your local master updated and branches rebased on top of it. What the script does is:
- stores current branch
- checkout [branch] (passed as a first parameter, master by default)
- makes
git pull
- check out back stored branch
- makes
git rebase [branch]
If any error, script stops.