gx oops is a safer, friendlier wrapper around git commit --amend. It lets you fix the last commit message, add forgotten files, or do both at once.
Usage
Flags
| Flag | Short | Description |
|---|---|---|
--message | -m | New commit message |
--add | File(s) to add to the last commit (repeatable) | |
--dry-run | Show what would change without making changes | |
--force | Allow amending even if the commit has already been pushed |
Behavior
- No flags: Opens your editor to amend the commit message interactively
-monly: Replaces the commit message--addonly: Adds files to the last commit without changing the message (--no-edit)- Both
-mand--add: Adds files and changes the message in one operation
Examples
Edge cases
Edge cases
- If a file passed to
--adddoes not exist, gx exits withERROR File not found: <path> - If a file passed to
--addhas no changes (clean ingit status), gx skips it withWARN Skipping <file>: no changes detected - If all
--addfiles are skipped and no-mis provided, gx prints> No files with changes to add.and exits - Using
--add .stages everything, similar togit add .