Skip to content

Instantly share code, notes, and snippets.

@peternewman
Created August 29, 2024 22:38
Show Gist options
  • Select an option

  • Save peternewman/5c3948699ed01340eb342295aa660b71 to your computer and use it in GitHub Desktop.

Select an option

Save peternewman/5c3948699ed01340eb342295aa660b71 to your computer and use it in GitHub Desktop.
git squash keeping history
# Make a backup copy of the branch
git clone
git rebase -i --root --committer-date-is-author-date --keep-empty
# Push to upstream branch
git push upstream HEAD:main --force-with-lease
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment