Skip to content

Instantly share code, notes, and snippets.

@mario21ic
Created December 18, 2015 17:04
Show Gist options
  • Save mario21ic/0d67135c6f2298e656b6 to your computer and use it in GitHub Desktop.
Save mario21ic/0d67135c6f2298e656b6 to your computer and use it in GitHub Desktop.
Script to merge branchs git
#!/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