Created
May 15, 2013 15:42
-
-
Save frontmesh/5584949 to your computer and use it in GitHub Desktop.
Seqence of git merge commands for pulling and merging remote branches
This file contains 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 | |
current_branch=`git branch|grep "*" | cut -d " " -f 2 ` | |
target_branch=$1 | |
if [ -z "$1" ] | |
then | |
echo "No target branch supplied" | |
else | |
`git checkout $target_branch` | |
`git pull origin $target_branch` | |
`git checkout $current_branch` | |
`git merge $target_branch` | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment