Skip to main content
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

Behavior

  • No flags: Opens your editor to amend the commit message interactively
  • -m only: Replaces the commit message
  • --add only: Adds files to the last commit without changing the message (--no-edit)
  • Both -m and --add: Adds files and changes the message in one operation

Examples

Pushed commits: By default, gx oops refuses to amend a commit that has already been pushed to a remote branch. Amending pushed commits rewrites shared history and can cause problems for collaborators. Use --force to override this safety check if you know what you are doing.
  • If a file passed to --add does not exist, gx exits with ERROR File not found: <path>
  • If a file passed to --add has no changes (clean in git status), gx skips it with WARN Skipping <file>: no changes detected
  • If all --add files are skipped and no -m is provided, gx prints > No files with changes to add. and exits
  • Using --add . stages everything, similar to git add .