Created
November 11, 2014 15:34
-
-
Save theconsultant/1dc02bc3754abaf74f9b to your computer and use it in GitHub Desktop.
Script to switch to master, update it, then merge with branch you were in before.
This file contains 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
#!/bin/bash | |
echo "Noting which branch you are currently in." | |
MYBRANCH=`git rev-parse --abbrev-ref HEAD` | |
echo $MYBRANCH | |
echo "Updating current branch" | |
git pull | |
#echo "Branch list" | |
#git branch --list | |
echo "Switching to Master" | |
git checkout master | |
echo "Updating master branch" | |
git pull | |
echo "Switching to previous branch" | |
git checkout $MYBRANCH | |
echo "Merging with Master" | |
git merge master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment