There are many opinions on the "ideal" style in the world of development. Therefore, in order to reduce the confusion on what style internal and external developers should follow during the course of their projects, we urge all technical team members to refer to this style guide for their projects.
Another good reason to follow the a common commit style guide is that it allows us to later automatically generate CHANGELOG.md from your commit messages. An example of CHANGELOG exporter script is available here. If interested, check out this blog for more information on CHANGELOG.
A commit messages consists of three distinct parts separated by a blank line: the title, an optional body and an optional footer. The layout looks like this:
type: subject
body
footer
The title consists of the type of the message and subject.
The type is contained within the title and can be one of these types:
Subjects should be no greater than 50 characters, should begin with a capital letter and do not end with a period.
Use an imperative tone to describe what a commit does, rather than what it did. For example, use change; not changed or changes.
Not all commits are complex enough to warrant a body, therefore it is optional and only used when a commit requires a bit of explanation and context. Use the body to explain the what and why of a commit, not the how.
When writing a body, the blank line between the title and the body is required and you should limit the length of each line to no more than 72 characters.
The footer is optional and is used to reference issue tracker IDs.
feat: Summarize changes in around 50 characters or less
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of the commit and the rest of the text as the body. The
blank line separating the summary from the body is critical (unless
you omit the body entirely); various tools like `log`, `shortlog`
and `rebase` can get confused if you run the two together.
Explain the problem that this commit is solving. Focus on why you
are making this change as opposed to how (the code explains that).
Are there side effects or other unintuitive consequenses of this
change? Here's the place to explain them.
Further paragraphs come after blank lines.
- Bullet points are okay, too
- Typically a hyphen or asterisk is used for the bullet, preceded
by a single space, with blank lines in between, but conventions
vary here
If you use an issue tracker, put references to them at the bottom,
like this:
Resolves: #123
See also: #456, #789
Forked from Udacity Style guide doc linked below.
Download to your project directory, add README.md
, and commit:
curl -LO http://git.io/Xy0Chg
git add README.md
git commit -m "Use README Boilerplate"
Replace the contents of README.md
with your project's:
Feel free to remove any sections that aren't applicable to your project.
Avoid abandoned or empty project folders. Take the time to remove projects you don't need or groom duplicates.
Try to fork projects you intend to modify. In some instances you may need a fork for reference but try avoid cluttering your repositories with too many forks.
Avoid cryptic naming conventions.
Make an effort to include a description of and link to your project enough explain in less than the length of a tweet of what your code is trying to accomplish.
Checkout the Readme Guide and take this style guide to heart. :D
Use your choose a professional handle ideally in the format @ndi-handle and your real name so we know this profile belongs to you.
Profile images are optional but should you choose one, use a professional profile image of yourself so that we can put your face to your code.
Take the time to include vital information such as work contact information so that external teams can find you in one place.