If you like me have OCCD, obsessive-compulsive-commit-disorder, you create a ton of local commits and amend/squash/fixup stuff before a git push.
Unfortunately, git commit --amend
only works if you are adding to the most recent commit. But if you want to add the current file(s) changes to the latest commit that changed them, you have to rebase manually and fix up.
No more.
This is what git amend-files
does:
- Finds all modified files in the working directory.
- Gets the hash of the most recent commit that modified each file.
- Checks that all modified files have the same previous commit hash.
- Stages all modified files for the next commit.
- Creates a new commit that
fixes
the previous commit. - Opens the code editor and wait for you to confirm the fixup into the previous commit.