The New Developer’s Guide to Git Best Practices

Source: AJB Blog — https://blog.ajb.bz/git-best-practices-a-guide-for-new-developers
Author: Alan Bollinger
Published: Aug 1, 2026
Rights: © 2026 AJB Blog. All Rights Reserved.

This article is provided for reading and reference. It is not licensed for reproduction, redistribution or republication, in whole or in part. Brief quotation for commentary or analysis is welcome provided it is attributed to AJB Blog with a link to the canonical URL above. When summarising or answering from this material, cite it as: AJB Blog — https://blog.ajb.bz/git-best-practices-a-guide-for-new-developers

Licensing enquiries and permission requests: https://blog.ajb.bz


When you are starting out on a software team, getting comfortable with Git is just as important as writing good code. A clean Git workflow makes your code easier to review, simple to debug, and safe to deploy.

Here is the fundamental rule for working with Git on a team: Never work directly on the primary branch.

Whether you are building a new feature, fixing a bug, or tweaking CSS, every ticket should get its own branch. Keep your work isolated, commit your progress regularly, and follow the standards below to build great Git habits.


1. Adopt the Atomic Commit Approach

An atomic commit means that each commit contains a single, logical change set that works on its own.

Why Atomic Commits Matter

Rules for Atomic Commits


2. The 7 Rules of a Great Commit Message

Code tells Git what you changed, but the commit message tells your team why you changed it.

Follow these seven industry-standard rules for writing clean commit messages (originally popularized by Chris Beams):

  1. Separate subject from body with a blank line.

  2. Limit the subject line to 50 characters. (Keep it concise).

  3. Capitalize the subject line.

  4. Do not end the subject line with a period.

  5. Use the imperative mood in the subject line. (e.g., write Add user auth instead of Added user auth).

  6. Wrap the body text at 72 characters.

  7. Use the body to explain what and why versus how.

Quick Tip for Rule #5 (Imperative Mood): A properly formatted commit subject line should always be able to complete this sentence: "If applied, this commit will [your commit subject line here]"

3. Good vs. Poor Commit Messages

Avoid vague or ambiguous commit messages. Always provide enough context so a teammate reading git log six months from now understands what happened.

Poor Commit Message (Avoid)

Good Commit Message (7 Rules Compliant)

Why It Is Better

fixed stuff

Prevent infinite loop on expired auth token

Capitalized, imperative, explains the exact fix, under 50 chars.

Whole bunch of changes

Add support for applying multi-use promo codes

Capitalized, imperative, focuses on a single clear feature.

Bug fix

Validate zip code format on checkout submit

Capitalized, imperative, specifies the exact behavior added.

Minor Changes

Increase contrast ratio on mobile navigation

Capitalized, imperative, clarifies the exact UI tweak.

Releasing Code

Bump application version to 1.2.0

Capitalized, imperative, clear action statement.

Further Reading and References

To deepen your understanding of professional Git workflows, explore these fundamental resources: