Skip to content

Commit

Permalink
Reformat git to Git
Browse files Browse the repository at this point in the history
- Git is a proper noun.
  • Loading branch information
BenGitsCode committed Oct 27, 2017
1 parent 2ed72d7 commit de2dbaf
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions git/commit-message-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is another that I've actually been using for a while, but feels worth adding here.

If you've used git even a little, you probably recognize this message:
If you've used Git even a little, you probably recognize this message:

```sh
# Please enter the commit message for your changes.
Expand All @@ -19,16 +19,20 @@ If you've used git even a little, you probably recognize this message:
What many people don't realize, is that you can actually customize that message. Doing so allows you to not only have a nice guide for your
commits, but you can have several different templates per project or workplace to best follow specific conventions or commit formats.

## Examples of use
## Setup

1. All you need to do is put your template of choice (remember: anything preceded by a `#` will be commented out) in a file `~/.gitmessage`.
1. Ensure you have this line `template =~./gitmessage` under the `[commit]` header in your git config file.
1. You can also do this in a one-line command in the terminal `git config --global commit.template ~/.gitmessage.txt` That's the default, but you name
the file whatever you'd like and/or set up several different templates.

### My Template

You can find the template I use most (at last as of the date I pushed this update) [here](https://cl.ly/nLu6)

- This is a mixture of things I've found helpful, and is probably a bit overkill. Feel free to customize your commit message template based on your
preferences, workplace conventions or needs.
- I like having:
preferences, workplace conventions or needs. I like having:

1. Some visual of the line length so I don't go over (plenty of text editor plugins that will do this just as well...or better)
1. A reminder to use imperative language in the subject line.
1. A couple questions that get me thinking not just about what the change is and not even just why make the change? These questions help me
Expand All @@ -39,3 +43,5 @@ accordance with one of these. I don't always follow those leading active verbs m
## Credit

** I've seen this a few places but the first was [here](https://robots.thoughtbot.com/better-commit-messages-with-a-gitmessage-template) by [Thoughtbot](https://thoughtbot.com/) **

** You can find more in [the Git Docs](https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration) just under the heading `Basic Client Configuration`**

0 comments on commit de2dbaf

Please sign in to comment.