Last active
May 3, 2019 08:58
-
-
Save spyzhov/820debcd980fbd4231d3d8a332659876 to your computer and use it in GitHub Desktop.
Review git changes in branch
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
#!/usr/bin/env bash | |
BRAN=$1 | |
DEST=master | |
if [ "$(git status -s)" != "" ] ; then | |
echo "Have unstashed changes" | |
exit 1 | |
fi | |
if [ $# == 0 ] || [ $1 == "-h" ] || [ $1 == "--help" ] ; then | |
echo "Help: $0 BRANCH [MASTER]" | |
exit 0 | |
fi | |
if [ $# == 2 ] ; then | |
DEST=$2 | |
fi | |
git checkout master && git pull && \ | |
git checkout $BRAN && git pull && \ | |
git checkout $DEST && git pull && \ | |
git merge --no-ff --no-commit $BRAN | |
# clear: git reset --hard |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment