Created
December 18, 2015 17:04
-
-
Save mario21ic/0d67135c6f2298e656b6 to your computer and use it in GitHub Desktop.
Script to merge branchs git
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 | |
if [ -z $1 ]; | |
then | |
br_orig="master" | |
else | |
br_orig=$1 | |
fi | |
if [ -z $2 ]; | |
then | |
br_dest="pre" | |
else | |
br_dest=$2 | |
fi | |
echo "Updating "$br_orig | |
git checkout $br_orig && git pull origin $br_orig | |
echo "Updating "$br_dest | |
git checkout $br_dest && git pull origin $br_dest | |
echo "Merge "$br_orig" with "$br_dest" && Push" | |
git merge $br_orig && git push origin $br_dest | |
echo "Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment