git-commit-template

Git commit template for better commit messages

https://github.com/joelparkerhenderson/git-commit-template

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.3%) to scientific vocabulary
Last synced: 7 months ago · JSON representation ·

Repository

Git commit template for better commit messages

Basic Info
  • Host: GitHub
  • Owner: joelparkerhenderson
  • Default Branch: main
  • Size: 38.1 KB
Statistics
  • Stars: 229
  • Watchers: 3
  • Forks: 31
  • Open Issues: 0
  • Releases: 0
Created almost 8 years ago · Last pushed 12 months ago
Metadata Files
Readme Code of conduct Citation

README.md

Git commit template

DataGrip + PostgresSQL

Git commit template to improve your project's commit messages.

If you want to learn why we use this kind of template, see our repo How to write a great git commit message.

If you want to improve your git speed and capabilities, see our project GitAlias.

The template is below and is also at this link: git-commit-template.txt

Template

```sh

Write a title summarizing what this commit does.

Start with an uppercase imperative verb, such as

Add, Drop, Fix, Refactor, Bump; see ideas below.

Think of your title as akin to an email subject,

so you don't need to end with a sentence period.

Use 50 char maximum, which is this line's width.

Add your title here

Why is this change happening?

Describe the purpose, such as a goal, or use case, or user story, etc.

For every line, use 72 char maximum width, which is this line's width.

Why:

How is this change happening?

Describe any relevant algorithms, protocols, implementation spec, etc.

For every line, use 72 char maximum width, which is this line's width.

How:

Add any tags you want, such as search text, hashtags, keywords, codes.

For every line, use 72 char maximum width, which is this line's width.

Tags:

## Help

This git commit template is available at:

https://github.com/joelparkerhenderson/git-commit-template

How to write a good git commit message:

https://github.com/joelparkerhenderson/git-commit-message

Subject line imperative uppercase verbs:

Add = Create a capability e.g. feature, test, dependency.

Drop = Delete a capability e.g. feature, test, dependency.

Fix = Fix an issue e.g. bug, typo, accident, misstatement.

Bump = Increase the version of something e.g. a dependency.

Make = Change the build process, or tools, or infrastructure.

Start = Begin doing something; e.g. enable a toggle, feature flag, etc.

Stop = End doing something; e.g. disable a toggle, feature flag, etc.

Optimize = A change that MUST be just about performance, e.g. speed up code.

Document = A change that MUST be only in the documentation, e.g. help files.

Refactor = A change that MUST be just refactoring.

Reformat = A change that MUST be just format, e.g. indent line, trim space, etc.

Rephrase = A change that MUST be just textual, e.g. edit a comment, doc, etc.

For the subject line:

* Use 50 characters maximum.

* Do not use a sentence-ending period.

For the body text:

* Use as many lines as you like.

* Use 72 characters maximum per line for typical word wrap text.

## Trailers

Trailers suitable for tracking and also for git interpret-trailers.

Example of "See:" trailers that mean "see this additional information"

and links to relevant web pages, issue trackers, blog posts, etc.:

See: https://example.com/

See: Issue #123 https://example.com/issue/123

We like to use the "See:" trailers to link to issue trackers (e.g. Jira,

Asana, Basecamp, Trello), document files and folders (e.g. Box, Dropbox),

UI/UX designs (e.g. Figma, Lucidchart), reference pages (e.g. Wikipedia,

internet RFCs, IEEE standards), and web posts (e.g. StackOverflow, HN).

Example of "Co-authored-by:" trailers that list each author's name

and their preferred commit message email address or contact URL:

Co-authored-by: Alice Adams alice@example.com

Co-authored-by: Bob Brown https://bob.example.com

We like to use the "Co-authored-by:" trailers when we pair program,

triple program, and group program. These are parsed automatically by

some version control services (e.g. GitHub, GitLab) and will link

to the authors' accounts and show up on the authors' commit history.

Example of "Sponsored-by:" trailers that list each sponsor's name,

which could be a person's or organization's, and contact email or URL:

Sponsored-by: Adam Anderson adam@example.com

Sponsored-by: Bravo Organization https://bravo.example.com

The git tools require trailers to be last in a commit message,

and must be one trailer per line, and with no extra lines between.

## About

This is our team's starting point for our git commit messages.

You can edit this template as you like, to customize it.

For more information about git commit ideas and help:

https://github.com/joelparkerhenderson/git-commit-message

## Usage

Put the template file here:

~/.git-commit-template.txt

Configure git to use the template file by running:

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

Add the template file to the ~/.gitconfig file:

[commit]

template = ~/.git-commit-template.txt

If you prefer other file locations or ways of working,

you can freely adjust the usage as you like.

## Usage needs commit.cleanup strip

This template intends for the commit to strip the comments.

To strip the comments, your git commit.cleanup config must be strip.

If you don't use strip, then these commit comments won't be deleted.

## More ideas

Some teams like to add a git commit message verification processes,

such as a git pre-commit hook that runs a linter on the message text.

In our experience, this can be helpful especially if the linter can

provide advice that explains how to make the message better.

## Tracking

* Package: git-commit-template

* Version: 7.2.0

* Updated: 2022-11-22T00:55:28Z

* Licence: GPL-2.0-or-later or contact us for custom license.

* Contact: Joel Parker Henderson (http://joelparkerhenderson.com)

GIT TRAILERS -- THESE MUST BE LAST IN THE COMMIT MESSAGE

Git trailers are optional. Use them if you want, how you want.

The trailers below are provided as examples that you can customize.

For example, you can add any relevant links to a blog post, or graphic

design images, or industry publications, specifications, tickets, etc.

See: Description https://example.com/...

See: Description https://example.com/...

If the commit is written by multiple people, then use the git trailers

to thank each person as a co-author; various git tools can track this.

Co-authored-by: Name name@example.com

Co-authored-by: Name name@example.com

If the commit is sponsored by a person or company, then add them here.

This kind of trailer is more-frequent in open source funding projects.

Sponsored-by: Name name@example.com

Sponsored-by: Name name@example.com

```

Owner

  • Name: Joel Parker Henderson
  • Login: joelparkerhenderson
  • Kind: user
  • Location: California

Software developer. Technology consultant. Creator of GitAlias.com, NumCommand.com, SixArm.com, and many open source projects.

Citation (CITATION.cff)

cff-version: 1.2.0
title: Git commit template
message: >-
  If you use this work and you want to cite it,
  then you can use the metadata from this file.
type: software
authors:
  - given-names: Joel Parker
    family-names: Henderson
    email: joel@joelparkerhenderson.com
    affiliation: joelparkerhenderson.com
    orcid: 'https://orcid.org/0009-0000-4681-282X'
identifiers:
  - type: url
    value: 'https://github.com/joelparkerhenderson/git-commit-template/'
    description: Git commit template
repository-code: 'https://github.com/joelparkerhenderson/git-commit-template/'
abstract: >-
  Git commit template
license: See license file

GitHub Events

Total
  • Watch event: 16
Last Year
  • Watch event: 16

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 22
  • Total Committers: 1
  • Avg Commits per committer: 22.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 1
  • Committers: 1
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Joel Parker Henderson j****l@j****m 22
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 3
  • Total pull requests: 1
  • Average time to close issues: 2 minutes
  • Average time to close pull requests: about 9 hours
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 3.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • trik-flip (3)
Pull Request Authors
  • shelbyKiraM (1)
Top Labels
Issue Labels
Pull Request Labels