Skip to content

Commit

Permalink
Update Git_commit.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tlinjordet authored Apr 23, 2021
1 parent 2411490 commit d43d134
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion Git_commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,47 @@ Initially adapted from a [blog post](https://chris.beams.io/posts/git-commit/).

We want commit messages to be concise and consistent, to communicate the context of a change.

* The `diff` contains *what* changes were made, the `commit` explains *why* they were made.
* The `diff` contains *what* and *how* changes were made, the `commit` primarily explains *why* they were made.
* Consistent commit message style
* simplifies both reading and writing commit messages, and
* supports communication and collaboration.

## Context

There are different ways and contexts whereby a commit message is added, but for simplicity we assume you made some changes, and did the following commands in the terminal:
```
git add .
git commit
```

You will then have vi open and provide the following starting point:
```
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
# Your branch is up to date with 'origin/master'.
#
# Changes to be committed:
# new file: foo
#
```

And then your job is to write a good commit message! Document why you are making the commit and the associated changes.

## Rules

You should at least write a single line if your commit only needs a brief explanation. We'll call this the subject, whether or not you also write a longer text, called the body, below the subject.

### Subject

The subject should be
* captialized, e.g. *Combine the Christmas lighbulbs*,
* maximum 50 characters,
* written with no terminating period, and
* the subject should be written in the *imperative mood*.

## Writing style conventions

* Write complete and grammatical sentences in English, with regular punctuation, e.g, finishing with a period.
Expand Down

0 comments on commit d43d134

Please sign in to comment.