Skip to content

Instantly share code, notes, and snippets.

@zacharyliu
Last active November 4, 2023 02:44
Show Gist options
  • Save zacharyliu/ddaec454a0e3b8506795 to your computer and use it in GitHub Desktop.
Save zacharyliu/ddaec454a0e3b8506795 to your computer and use it in GitHub Desktop.
oneliner to squash all commits ahead of origin/master into one commit
git reset --hard `git merge-base --fork-point origin/master` && git merge --squash HEAD@{1} && git commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment