Amend Git Commit

0•

Updates the most recent Git commit by automatically staging changes and optionally revising the commit message.

This skill streamlines the development workflow by allowing users to quickly modify their last Git commit without manual command entry. It automatically handles the staging of unstaged changes, integrates optional new commit messages following Conventional Commits standards, and includes a critical safety check to prevent rewriting history on shared remote branches. It is a perfect utility for developers looking to maintain a clean, professional commit history while fixing small errors or adding forgotten files immediately after a commit.

Key Features

01Supports custom commit messages with Conventional Commits formatting
02Preserves existing commit messages when no new input is provided
03Prevents history rewriting with safety checks for pushed commits
04Ensures correct message formatting using HEREDOC execution
05Automatically stages unstaged and staged changes before amending
060 GitHub stars

Use Cases

01Updating a commit message to adhere to project naming conventions
02Adding forgotten files to the last commit to keep history concise
03Fixing a typo or small bug in the most recent local commit