Created
April 25, 2017 05:46
-
-
Save xml/8eb5a73b3cbeb4adecf8b013671f85d0 to your computer and use it in GitHub Desktop.
Shell Script for Git: Update Master and Return to Current Branch
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
function mu() { | |
branch=`git rev-parse --symbolic-full-name --abbrev-ref HEAD` | |
echo "After updating master, will return to $branch..." | |
git checkout master | |
#TO-DO: check status and only pull if not up-to-date... | |
git pull | |
git checkout $branch | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment