tips
7 tips Commit
One command, setting or habit at a time about Commit: what it does, the line to copy and a caveat or two.
Git settings and fixes 6
-
Commit new content with the message and authorship of an existing commit.
git commit -C ORIG_HEAD -
Queue a better message for an earlier commit without touching its files.
git commit --fixup=reword:HEAD~1 -
Stop Git from silently dropping message lines that start with a hash.
git config --global commit.cleanup scissors -
Write a subject and a body from the command line without opening an editor.
git commit -m "Fix login redirect" -m "The old code sent signed-out users to a 404." -
Starts every commit message editor with a text of your own, such as a checklist.
-
Adds your staged changes to the previous commit without touching its message.
git add forgotten-file.txt
Hooks 1
-
Runs a script on every commit message and cancels the commit when the script exits with an error.
if ! head -n1 "$1" | grep -qE '^[A-Z]'; then
Nothing in this filter yet.