Git Product home page Git Product logo

commit-guidelines's Introduction

Commit Guidelines

Mostly reasonable guidelines for commit messages.

Commit Message Format

Commit messages consist of a message, description and related.

<message>

<description>

<related>

A message consists of a type, scope, and subject.

No line should be longer than 80 characters long, for optimal github viewing.

Message

<type>(<scope>): <subject>

Examples: refactor(plans#show): remove 1 of 4 templating languages

Type

  • feat: New feature
  • fix: Bug fix
  • format: Change not affecting the meaning of code (white-space, formatting, etc)
  • docs: Documentation-only change
  • style: Stylesheet-only change
  • refactor: Change that neither fixes a bug or adds a feature
  • perf: Change that improves performance
  • test: Addition of a missing test
  • chore: Changes to the build process or auxiliary tools and libraries

Scope

The scope could be anything specifying the site of the commit change. For example plans#show, PlanPerson, LiveChatMessageList, .tab-list, etc...

Subject

The subject contains a succinct description of the change:

  • use the imperative, present tense: "change" not "changed" nor "changes"
  • don't use capitalize first letters
  • don't use trailing punctuation (.)

Description

Just as in the subject, use the imperative, present tense: "change" not "changed" nor "changes" The body should include the motivation for the change.

Related

The footer should contain any information about Breaking Changes and is the place to reference Trello cards, or GitHub issues that the commit Closes.

Attribution

This guide is pirated from inspired by Angular's excellent CONTRIBUTING.md.

A detailed explanation can be found in this document.

fixup commits

Your stuff's on staging but you're making small, progressive tweeks. fixup is your friend.

Fixup commits are associated with commit you've already made. They allow you to make commits without inserting additional messages. They can also be automatically squashed, for those civilized developers.

Here's how it works. commit takes --fixup as on option. When used, you'll have to provide the SHA of the commit your is fixing up. Like so:

git commit --fixup a9b8c7

# aliases also work but get confusing after your first fix

git commit --fixup head

You probably don't memorize your recent commit SHAs. You can use the syntax below as a backword search. This fixup commit will attach to the most recent commit, where "style" is in the message:

git commit --fixup :/style

commit-guidelines's People

Contributors

chantastic avatar

Watchers

James Cloos avatar bryan 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.