What problem does it solve?
Amending Git commits, especially older ones or those already pushed, can be risky, leading to unintended changes or requiring force pushes. This Skill provides a safe, controlled workflow for amending commits with critical safety checks, preventing errors and preserving history integrity.
Core Features & Use Cases
- Selective Staging: Ensures only the explicitly specified files are staged for amendment, preventing accidental inclusion of unrelated changes.
- Authorship Verification: Prevents amending commits authored by others without explicit permission, preserving attribution.
- Push Status Check: Warns if a commit has already been pushed, alerting the user to the need for a force push.
- Non-HEAD Amend Workflow: Guides through the
fixup + autosquash workflow for safely amending older commits.
- Use Case: If you forgot to include a
config.json file in your last commit, use this Skill to safely add just that file to the commit, ensuring your history remains clean and accurate without affecting other changes or risking a messy rebase.
Quick Start
To add a forgotten file 'config.json' to your last commit:
git add config.json
git commit --amend --no-edit