Skip to content

Instantly share code, notes, and snippets.

@Tridy
Created October 17, 2022 07:41
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 Tridy/b7721cc078bbc021195f7e216c018c94 to your computer and use it in GitHub Desktop.
Save Tridy/b7721cc078bbc021195f7e216c018c94 to your computer and use it in GitHub Desktop.
Amend multiple Git commits with one line
git checkout yourBranch
git reset $(git merge-base main $(git branch --show-current))
git add -A
git commit -m "one commit on yourBranch"
git push -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment