User Tools

Site Tools


git_commit

This is an old revision of the document!


Overview

Miscellaneous notes on git commit, using the Linus kernel source as an example.

Checking what is about to be committed

git status

See which files are staged for committing:

$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   MAINTAINERS
	modified:   README

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   Makefile
$

Template

This might be worth setting at the system level.

$ git config --global commit.template ~/.gitmessage.txt

Example ~/.gitmessage.txt:

Subject line (try to keep under 60 characters)

Multi-line description of commit,
feel free to be detailed.

[Ticket: X]
git_commit.1550650913.txt.gz · Last modified: 2019/02/20 08:21 by rpjday