Git Advanced: Git Workflows and Best Practices

Join the AI Workshop to learn more about AI and how it can be applied to web development. Next cohort February 1st, 2026

The AI-first Web Development BOOTCAMP cohort starts February 24th, 2026. 10 weeks of intensive training and hands-on projects.


A Git workflow is a strategy for how you and your team use branches, commits, and merges. Having a clear workflow prevents confusion and keeps your repository organized.

The Two-Branch Workflow

A popular workflow inspired by A successful Git branching model uses two permanent branches: master (or main) and develop.

Daily Rules

Quick features or non-breaking changes:

  • Commit directly on develop, or
  • Create a quick feature branch and merge it to develop

Multi-commit features that might break things:

  • Create a feature branch
  • Work on it until stable
  • Merge to develop when ready

Hotfixes for Production

When something on production needs immediate attention:

  1. Create a short hotfix branch from master
  2. Fix the issue
  3. Test locally and on a test machine
  4. Merge to both master and develop

Quick Features Needed in Production

If develop is unstable but you need a quick feature in production:

  1. Create a feature branch from master (skipping develop)
  2. Implement the feature (keep it fast and trivial)
  3. Merge to both master and develop

Only do this for simple changes. If it gets complicated, wait for develop to stabilize.

Preparing Releases

When ready to release:

  1. Put develop on a “freeze”—no new features
  2. Test all workflows and verify code quality
  3. Merge develop into master
  4. Tag with a version number

Tagging

Every time you merge to master, tag it:

git tag v1.2.3
git push origin v1.2.3

Tags make it easy to roll back if something goes wrong.

Benefits for Solo Developers

Even if you work alone, Git provides:

Backup

Your code is on GitHub. If your laptop is stolen or backups fail, your code is safe.

Version Control

Go into rabbit holes and easily get back to a working state.

Historical Log

Your commit messages explain what you did and why, even years later.

Bug Investigation

Use git bisect to find when a bug was introduced.

Easy Reverts

Need to undo a change from a year ago (like removing a Black Friday promotion)? Git makes it easy.

Deployment Integration

Platforms like Netlify, Vercel, and Railway deploy automatically when you push to GitHub.

Automation

Set up Git Hooks and GitHub Actions to run tests, linting, or any custom workflow.

Open Source Participation

Git skills let you contribute to open source projects and potentially release your own work.

Learning Resources

Introductory

In-Depth

Videos

Summary

  1. Choose a workflow that fits your team size and project
  2. Use branches to isolate work
  3. Tag releases for easy rollbacks
  4. Commit often with meaningful messages
  5. Even solo developers benefit enormously from Git

Lessons in this unit:

0: Introduction
1: Working with Remotes
2: Squashing Commits
3: Rebase vs Merge
4: Git Bisect for Debugging
5: Git Worktrees
6: Git Submodules
7: Understanding Detached HEAD
8: Managing Secrets in Git
9: ▶︎ Git Workflows and Best Practices
10: How to push to 2 repositories at the same time and keep them in sync
11: How to update a Git branch from another branch
12: Git, detached HEAD
13: Trigger deploys on Netlify with submodules
14: A Git Cheat Sheet
15: Git, squashing vs not squashing
16: An incomplete list of great Git tutorials
17: Git, what if you forgot to add a file to a commit?
18: Git workflow to manage work on multiple branches
19: How to setup the Git SSH keys