Created
October 20, 2014 19:07
-
-
Save mbenford/792acb7697c6f02b8904 to your computer and use it in GitHub Desktop.
Bash script to checkout either the latest release branch or the one specified
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
#!/bin/bash | |
set -e | |
if [ "$1" != "" ]; then | |
release_name="release/$1" | |
else | |
release_name=$(git branch -r | tail -n1 | sed 's/.*origin\///') | |
fi | |
echo "Checking out branch '$release_name'..." | |
git checkout $release_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can you explain the method