Skip to content

Instantly share code, notes, and snippets.

@tgvashworth
Last active December 18, 2015 01:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tgvashworth/5704768 to your computer and use it in GitHub Desktop.
Save tgvashworth/5704768 to your computer and use it in GitHub Desktop.
Make staging easy.
#!/bin/sh
# install:
# cd /usr/local/bin && wget -O stage-me https://gist.github.com/phuu/5704768/raw/gistfile1.sh && chmod u+x stage-me
branch=`git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3-`
echo "Merging ⭠ $branch into ⭠ staging."
read -p "Is this correct? [y/N] : " -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
git checkout staging &&
git pull &&
git merge --no-ff $branch &&
git push &&
git checkout $branch
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment