Coder Social home page Coder Social logo

commit-message-format's Introduction

Commit Message Format

This repositories includes guidelines and best practices to formulate git commit messages.

{type}: {subject}

{body}

Issue(s): #{issue-number}

type and header are mandatory.

Example FIX: remove unused dependency lodash.camelcase

Any line of the commit message cannot be longer 72 characters. This allows the message to be easier to read on GitHub as well as in various git tools.

Type

Must be one of the following:

  • FEAT: A new feature.
  • FIX: A bug fix.
  • DOCS: Documentation only changes.
  • STYLE: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc).
  • REFAC: A code change that neither fixes a bug nor adds a feature.
  • PERF: A code change that improves performance.
  • TEST: Adding missing tests.
  • CHORE: Changes to the build process or auxiliary tools and libraries such as documentation generation.

Subject

The subject contains succinct description of the change:

  • use the imperative, present tense: change not changed nor changes,
  • don't capitalize first letter,
  • no dot (.) at the end.
  • Use one line with a max of 50 chars

Body

Just as in the subject, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior. A blank line above the body is mandatory if the body is presented.

  • Bullet points are okay, too.
  • Typically a hyphen or asterisk is used for the bullet, followed by a single space. Use a hanging indent.

Issues

If working on an issue, provide its number preceded by a hashtag #. If provided, a blank line above is mandatory.


Rules for a great git commit message style

  • Separate subject from body with a blank line
  • Do not end the subject line with a period
  • Capitalize the subject line and each paragraph
  • Use the imperative mood in the subject line
  • Wrap lines at 72 characters
  • Use the body to explain what and why you have done something. In most cases, you can leave out details about how a change has been made.

Information in commit messages

  • Describe why a change is being made.
  • How does it address the issue?
  • What effects does the patch have?
  • Do not assume the reviewer understands what the original problem was.
  • Do not assume the code is self-evident/self-documenting.
  • Read the commit message to see if it hints at improved code structure.
  • The first commit line is the most important.
  • Describe any limitations of the current code.
  • Do not include patch set-specific comments.

References

commit-message-format's People

Contributors

bene-we avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.