Skip to content

Instantly share code, notes, and snippets.

@spyzhov
Last active May 3, 2019 08:58
Show Gist options
  • Save spyzhov/820debcd980fbd4231d3d8a332659876 to your computer and use it in GitHub Desktop.
Save spyzhov/820debcd980fbd4231d3d8a332659876 to your computer and use it in GitHub Desktop.
Review git changes in branch
#!/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