Commits with Git provide accountability by attributing authors with changes to code. Git offers multiple features for the specificity and security of commits. This topic explains and demonstrates proper practices and procedures in committing with Git.


  • git commit [flags]


Parameter             Details
--message, -mMessage to include in the commit. Specifying this parameter bypasses Git's normal behavior of opening an editor.
--amendSpecify that the changes currently staged should be added (amended) to the previous commit. Be careful, this can rewrite history!
--no-editUse the selected commit message without launching an editor. For example, git commit --amend --no-edit amends a commit without changing its commit message.
--all, -aCommit all changes, including changes that aren't yet staged.
--dateManually set the date that will be associated with the commit.
--onlyCommit only the paths specified. This will not commit what you currently have staged unless told to do so.
--patch, -pUse the interactive patch selection interface to chose which changes to commit.
--helpDisplays the man page for git commit
-S[keyid], -S --gpg-sign[=keyid], -S --no-gpg-signSign commit, GPG-sign commit, countermand commit.gpgSign configuration variable
-n, --no-verifyThis option bypasses the pre-commit and commit-msg hooks. See also Hooks

Related Examples