gt modify¶
Amend the current commit with staged changes.
Usage¶
Options¶
| Option | Description |
|---|---|
-m, --message <msg> |
New commit message |
--no-edit |
Keep existing commit message |
Examples¶
Amend with Staged Changes¶
Update Commit Message¶
Keep Message, Add Changes¶
Behavior¶
- Amends the current HEAD commit with staged changes
- Preserves authorship information
- Updates the commit timestamp
Rebasing Downstream
After modifying a commit, you should run gt restack to update any child branches that depend on it.
Workflow¶
Typical workflow when making changes:
# Make changes
vim src/feature.rs
# Stage changes
git add src/feature.rs
# Amend the commit
gt modify
# Update child branches
gt restack
Related Commands¶
gt restack- Update child branchesgt squash- Squash multiple commitsgt fold- Fold into previous commit