Skip to content

Instantly share code, notes, and snippets.


westonruter/ Secret

Last active Aug 29, 2015
What would you like to do?
# Merge the current branch into the preview branch, push, and return to the original branch.
set -e
current_branch=$( git rev-parse --abbrev-ref HEAD )
if [ 'preview' == "$current_branch" ]; then
echo "Oops. You're already on the preview branch. Do you get merge conflicts?"
exit 1
git checkout preview
git pull origin preview
git merge "$current_branch" --no-edit
git push -u origin preview
git checkout "$current_branch"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment