commitAll
Commit all tracked changes without explicitly staging them first.Function Signature
Parameters
The commit message.
Optional extended description.
Returns
A promise that resolves to the output from the commit command.
Example
When to use
UsecommitAll when you want to commit all modified tracked files without manually calling add() first. This is equivalent to git commit -a.
Note: This does not add untracked files. Only modifications to tracked files are included.
commitAmend
Amend the last commit with new changes or a modified message.Function Signature
Parameters
Optional new commit message. If omitted, keeps the existing message.
Optional extended description.
Returns
A promise that resolves to the output from the commit command.
Example
When to use
UsecommitAmend to:
- Fix typos in the last commit message
- Add forgotten files to the last commit
- Modify the last commit before pushing
commitEmpty
Create an empty commit with no changes.Function Signature
Parameters
The commit message.
Returns
A promise that resolves to the output from the commit command.
Example
When to use
UsecommitEmpty to:
- Trigger CI/CD pipelines
- Mark milestones or checkpoints
- Test commit hooks
- Create placeholder commits in a branch
commitFixup
Create a fixup commit for autosquash during interactive rebase.Function Signature
Parameters
The commit hash to create a fixup for.
Returns
A promise that resolves to the output from the commit command.
Example
When to use
UsecommitFixup when you need to fix a bug or issue in a previous commit during a feature branch. The fixup commit will be automatically squashed into the target commit when you run git rebase -i --autosquash.
This is particularly useful for:
- Fixing issues found during code review
- Making corrections to commits before merging
- Maintaining a clean commit history
commitNoEdit
Amend the last commit without editing the message and without staging new changes.Function Signature
Returns
A promise that resolves to the output from the commit command.
Example
When to use
UsecommitNoEdit when you need to add staged changes to the last commit but want to keep the existing commit message unchanged. This is a shortcut for git commit --amend --no-edit.
Common scenarios:
- Adding forgotten files to the last commit
- Including additional changes in the last commit
- Updating the commit without triggering an editor
commitReuseMessage
Reuse the commit message and authorship from an existing commit.Function Signature
Parameters
The commit hash to reuse the message from.
Returns
A promise that resolves to the output from the commit command.
Example
When to use
UsecommitReuseMessage when you need to:
- Apply similar changes as a previous commit
- Recreate a commit after rebasing or cherry-picking
- Use a well-crafted message from another commit
commitSignoff
Commit with a Signed-off-by trailer added to the commit message.Function Signature
Parameters
The commit message.
Optional extended description.
Returns
A promise that resolves to the output from the commit command.
Example
When to use
UsecommitSignoff when contributing to projects that require a Developer Certificate of Origin (DCO). The signoff certifies that you wrote the code or have the right to submit it.
Many open source projects require signoff for legal and compliance reasons, including:
- Linux kernel
- Many Apache Foundation projects
- Projects following the DCO process
commitWithAuthor
Commit with an explicit author different from the committer.Function Signature
Parameters
The commit message.
The author in the format
"Name <email>".Optional extended description.
Returns
A promise that resolves to the output from the commit command.
Example
When to use
UsecommitWithAuthor when you need to:
- Commit code written by someone else (e.g., pair programming)
- Import historical commits preserving original authorship
- Apply patches from contributors who don’t have direct access
- Maintain accurate attribution in collaborative projects