Skip to content

Git Best Practices Guide

Milindu Sanoj Kumarage edited this page Nov 19, 2017 · 1 revision

Commits

  1. Commit messages should ideally be in Simple Present Tense.

    "Add Google Analytics"

    Not

    "Added Google Analytics" or "Adding Google Analytics"

  2. Commit message should explain what the code change means.

    Following is not good.

    "Update .gitignore"

    Following is good.

    "Ignore node_modules"

  3. Commits should be small meaningful chunks.

    Don't commit several unrelated things in one commit.

    "Added React Bootstrap, implemented Get Users API endpoint"

    Break the changes into several commits

    Add React Bootstrap

    Implement Get Users API endpoint