gut save¶
Combines git add and git commit into one step. Optionally prompts for a commit message if none is provided.
Usage¶
Options¶
| Option | Description |
|---|---|
-m "message" |
Commit message (prompts interactively if omitted) |
--all, -a |
Stage all changes before committing (like git add -A) |
--amend |
Rewrite the last commit (message or staged content) |
[file...] |
Stage and commit specific files only |
Examples¶
# Commit already-staged files (prompts for message)
gut save
# Commit with a message
gut save -m "fix login redirect"
# Stage everything and commit
gut save --all -m "wip: refactor auth module"
# Stage and commit specific files
gut save src/login.js tests/login.spec.js -m "fix: null check"
# Amend the last commit with a new message
gut save --amend -m "fix: correct error message wording"
# Amend the last commit, opening the editor
gut save --amend
Behaviour¶
- Staging: If
--allis given, runsgit add -A. If specific files are provided, runsgit add <files>. Otherwise, nothing is staged only already-staged changes are committed. - Message: If
-mis not provided and there are staged changes, you are prompted to type a message interactively. An empty message is rejected. - Amend: If
--amendis set and there are staged changes, they are squashed into the last commit. If nothing is staged, it opens the editor to reword the last commit message.
Amend rewrites history
--amend rewrites the last commit. If you've already pushed it, you'll need gut sync --force to update the remote. Don't amend commits that others may have based work on.
See Also¶
gut statuscheck what's staged before savinggut undoun-save (undo) the last commitgut syncpush saved commits to the remote