What Is Version Control and Why Does It Matter?
Imagine working on a document for weeks, making hundreds of edits, and then realizing you deleted something critical three weeks ago that you desperately need back. With a regular file, that content is gone. With version control, you can go back to any point in the history and retrieve it.
Version control is software that tracks changes to files over time. Every change is recorded — who made it, when, and why. You can see the full history of a project, compare any two versions, undo any change, and work on multiple independent lines of development simultaneously.
For solo developers, version control is a sophisticated backup system and an unlimited undo button. For teams, it is the system that allows multiple people to modify the same codebase simultaneously without overwriting each other’s work.
This is not a nice-to-have. It is foundational infrastructure for any serious development work.
Git: The Universal Standard
Git is the version control system. It is used by virtually every professional development team in the world. Git was created by Linus Torvalds in 2005 to manage the Linux kernel codebase — one of the largest and most complex software projects in existence. It was designed to handle massive codebases with thousands of contributors efficiently.
Git is free, open source, and runs locally on your machine. It does not require any server or account to use — you can version your code entirely offline. When you want to share your code or collaborate with others, you push it to a remote repository.
Core Concepts
Repository (repo): A folder whose file history is tracked by Git. Everything inside the folder is versioned.
Commit: A snapshot of your repository at a specific point in time. A commit records exactly which files changed, what the changes were, and a message you write describing why you made the change.
Branch: A parallel version of your codebase. You create a branch to work on a feature or fix without disturbing the main codebase. When the work is complete and tested, you merge the branch back.
Remote: A copy of your repository stored on another server. GitHub, GitLab, and Gitea are platforms for hosting remote repositories.
The Basic Workflow
# Initialize Git in a new project folder
git init
# Check what files have changed
git status
# Stage files for the next commit (tell Git which changes to include)
git add filename.py
# Or stage everything:
git add .
# Create a commit with a descriptive message
git commit -m "Add user authentication endpoint"
# See the history of commits
git log --oneline
This four-command cycle — status, add, commit, log — is 80% of day-to-day Git usage.
Working With Remote Repositories
# Connect your local repo to a remote (e.g., GitHub or self-hosted Gitea)
git remote add origin https://github.com/yourusername/your-repo.git
# Push your local commits to the remote
git push origin main
# Pull changes from the remote (when collaborating)
git pull origin main
GitHub and Its Alternatives
GitHub is the largest platform for hosting Git repositories. It is owned by Microsoft. For open source projects, it provides free hosting, issue tracking, pull request workflows, and CI/CD integration.
For sovereign builders, GitHub dependency is a real concern. Microsoft can — and has — terminated accounts and removed repositories. If your development workflow is entirely dependent on GitHub, you are dependent on Microsoft’s continued goodwill.
Alternatives:
Gitea: Open source, self-hostable GitHub alternative. You can run your own Gitea instance on a $6/month VPS. Your code lives on infrastructure you control.
Codeberg: A free, nonprofit-hosted Gitea instance. No Microsoft, no corporate ownership. Excellent for public open source projects.
GitLab: Self-hostable, more feature-rich than Gitea (includes CI/CD, project management). The self-hosted Community Edition is free.
Forgejo: A community fork of Gitea with a governance structure independent of any company.
The recommended sovereign workflow: keep your authoritative repository on self-hosted Gitea or Codeberg, and optionally mirror to GitHub for visibility and discoverability in the open source ecosystem.
Branching for Feature Development
A fundamental Git practice: never work directly on the main branch in a team project.
# Create and switch to a new branch
git checkout -b feature/user-authentication
# Do your work, make commits...
git add .
git commit -m "Implement JWT token generation"
# When done, switch back to main and merge
git checkout main
git merge feature/user-authentication
Branches allow you to develop features in isolation, switch between tasks without losing work, and maintain a clean main branch that always contains working code.
Write Good Commit Messages
A commit message is documentation. Future you — and future collaborators — will read your commit history trying to understand what changed and why. Write messages that describe the intent, not just the action.
Bad: fix stuff
Bad: update code
Good: Fix rate limiter to correctly track requests per user hour
Good: Add Stripe webhook handler for subscription cancellation events
The standard format: a short summary on the first line (50 characters or less), followed by a blank line and a longer explanation if needed.
Version Control Is Mandatory
This is not optional. Every project you build should be in a Git repository from day one. The discipline of committing frequently, writing clear messages, and using branches appropriately will save you from disasters that would otherwise cost hours or days of lost work.
More importantly: when you collaborate with others — contractors, partners, employees — version control is the system that makes that collaboration safe. Without it, you are working on live files simultaneously, overwriting each other’s changes and creating chaos.
Set up Git. Commit early, commit often. Push to a remote repository. This is the foundation.