Skip to content

Instantly share code, notes, and snippets.

@rjurney
Created January 8, 2026 21:37
Show Gist options
  • Select an option

  • Save rjurney/1b0a8c4cf091c8fbb4d071d58bc8310b to your computer and use it in GitHub Desktop.

Select an option

Save rjurney/1b0a8c4cf091c8fbb4d071d58bc8310b to your computer and use it in GitHub Desktop.
Git command to commit changes after running pre-commit and fixing any outstanding issues
allowed-tools description
Bash(git checkout --branch:*), Bash(git status:*), Bash(git commit:*), Bash(gh pr create:*), Bash(pre-commit), Edit, Read, Write
Prepare and commit the code already added to git

Run pre-commit to find any outstanding problems with the changes already added to git. Once they are taken care of, you may git add only the original files I already added to re-run pre-commit. DO NOT add any other files to git. When pre-commit passes, commit the code. Don't use 'pre-commit run --all-files' to validate the code, just run 'pre-commit' to run it on files that are already git added. Add them before running pre-commit if you have made changes. If black says it reformatted a file, add it and then re-run pre-commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment