Skip to content

Instantly share code, notes, and snippets.

@douglascayers
Last active October 14, 2022 15:33
Show Gist options
  • Save douglascayers/8543195d4bae7cfd20cb02bc0916211f to your computer and use it in GitHub Desktop.
Save douglascayers/8543195d4bae7cfd20cb02bc0916211f to your computer and use it in GitHub Desktop.
Merge current branch into another then switch back
export HEAD=$(git branch --show-current) && \
git checkout -B staging origin/staging && \
git merge --no-ff $HEAD && \
git push && \
git checkout $HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment