Before we standardised on Git across our projects, our idea of version control was a folder full of site-final.zip, site-final-v2.zip and site-final-ACTUAL.zip. It worked, in the sense that nothing exploded - until two people edited the same file and someone's afternoon disappeared reconciling the difference by eye. Git fixes that, but only if the team agrees on a small set of habits, because the tool itself is flexible enough to be used badly.

Commits are a story, not a save button

The habit that changes everything first is writing commits that describe intent, not diffs:

git commit -m "Add sticky header on scroll for product pages"
# not:
git commit -m "fix stuff"

Six months later, git log becomes a readable changelog instead of an archaeology project.

A main branch line with a feature branch merging back in
A short-lived feature branch, merged back once it's reviewed.

One branch per piece of work

Our working pattern, which owes a lot to the "GitHub Flow" model, is deliberately simple: master is always deployable, and every piece of work - a feature, a fix, a content update - gets its own short-lived branch.

git checkout -b feature/sticky-header
# ...work, commit...
git push origin feature/sticky-header
# open a pull request, get a review, merge

The branch name says what it's for, the pull request is where a second pair of eyes catches the obvious mistake before it reaches a client's site, and once it's merged, the branch is deleted. Nothing lingers for months slowly drifting out of sync with everything else.

.gitignore before your first commit

Node modules, compiled CSS, local environment files - none of that belongs in version control, and adding a .gitignore after the fact means untangling history later:

node_modules/
.sass-cache/
.env
*.log

When it goes wrong

Two commands cover most panic moments. git stash shelves uncommitted work so you can switch branches without losing it, and git revert undoes a bad commit by adding a new commit that cancels it out - safer than rewriting history once something has been pushed and shared.

git stash
git checkout master
git revert <commit-hash>

None of this is exotic. It's a handful of habits, followed consistently, that turn Git from a source of anxiety into infrastructure nobody has to think about.

Branching is a communication tool, not just a technical one

A branch name like feature/checkout-validation tells the next person what's in progress before they open a single file. Combined with small, frequent commits and descriptive messages, the branch history becomes documentation of how a feature was actually built - genuinely useful six months later when something breaks and you need to understand why a decision was made.

git checkout -b feature/checkout-validation
git commit -m "Add client-side email format check"
git commit -m "Add server-side email uniqueness check"

Rebase locally, merge on shared branches

Rebasing a personal feature branch to keep history linear is safe and makes for a much cleaner pull request. Rebasing a branch other people have already pulled rewrites history out from under them and is the single most common way to create a genuinely confusing Git mess - the rule we hold every developer to is simple: never rebase a branch someone else might have based work on.