- git rebase -i HEAD~X - this allows you to merge interactively several commits
- then fixup OR pick OR reword AND push --force
- git reset --hard HEAD~X - this rollbacks the index back to X commits (check git status before doing this. Commit first)
- commit again using just one commit
- git reset --hard COMMIT_ID - this rollbacks the index back to the commit_id
Last active
November 30, 2023 21:28
-
-
Save alebaffa/cd61f177a79a4d857bcc55ba7c535f3a to your computer and use it in GitHub Desktop.
Git squash alternatives
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does the second method work when changes are already pushed to the remote?