Skip to content

Instantly share code, notes, and snippets.

@InBrewJ
Created March 16, 2020 14:48
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 InBrewJ/2bfa2fec1c756a15ddd666637d0d1993 to your computer and use it in GitHub Desktop.
Save InBrewJ/2bfa2fec1c756a15ddd666637d0d1993 to your computer and use it in GitHub Desktop.
How to convert a PR with already squashed commits into a single commit
# WARNING: THIS WILL GET RID OF THE COMMITS ON YOUR FEATURE BRANCH TOO!
# Original steps
# 1. Start with a clean version branch.
# 2. git reset master
# 3. git add . (notice trailing dot in there)
# 4. git commit -m "A really meaningful commit message"
# 5. git push --force
git reset master && \
git add . && \
git commit -am "$1" && \
git push --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment