Created
April 15, 2016 20:41
-
-
Save loren138/7aa50ceecc05e466f421c0adcb35563f to your computer and use it in GitHub Desktop.
Update and merge current branch with develop via stash for GitFlow or HubFlow
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 | |
set -e | |
branch=$(git rev-parse --abbrev-ref HEAD) | |
stash=false; | |
if ! git diff-index --quiet HEAD --; then | |
stash=true | |
git stash | |
fi | |
git checkout develop | |
git pull | |
git checkout $branch | |
git merge develop | |
if [ "$stash" = true ] ; then | |
git stash pop | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment