Created
August 18, 2016 14:41
-
-
Save dody87/ec0cb35b77053a7930f5385f80e76765 to your computer and use it in GitHub Desktop.
git merge script for many branches. Run sh merge.sh branch1 branch2 ...
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
branch=$(git symbolic-ref --short -q HEAD) | |
git pull origin $branch | |
git push origin $branch | |
for environment in "$@" | |
do | |
echo "Merging environment $environment" | |
git checkout $environment | |
git pull origin $environment | |
git merge $branch | |
git push origin $environment | |
git checkout $branch | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment