Is it possible to change the part:
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
To say:
# Staged:
Is it possible to change the part:
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
To say:
# Staged:
Yes, using a prepare-commit-msg
hook. This is a script in .git/hooks/
which is run between Git's generation of the commit message, and the commit message being opened in your editor.
As a simple example, copy the below text into a new file called prepare-commit-msg
in .git/hooks/
.
#!/bin/sh
sed -i '0,/# Changes to be committed:/c# Staged:' "$1"
If you find it doesn't work immediately, check it's executable: run chmod +x .git/hooks/prepare-commit-msg
.
(The script is a sed
one-liner to replace every line up to and including the "Changes to be committed" line with the text "# Staged:")
In an easy way, just that part, no.
But you could use the commit-msg hook to modify the commit msg.