Skip to main content
Back to blog
Git Basics Every Developer Should Know — Tutorial
Tutorial6 min read

Git Basics Every Developer Should Know

What is Version Control?

Version control is a system that records changes to files over time so you can recall specific versions later. Git is the most widely used distributed version control system — it tracks changes, enables collaboration, and never loses history.

Repositories

A repository (repo) is a folder that Git is tracking. Every repo contains a hidden .git directory that stores the full commit history. You can create a new repo with git init or download an existing one with git clone.

Commits

A commit is a snapshot of your project at a specific point in time. Each commit has:

  • A unique hash (e.g., 1a2b3c4)
  • A commit message describing the change
  • Author name and timestamp
  • A pointer to the parent commit

Make your first commit:

bash
git add .
git commit -m "Initial commit"

Branches

A branch is a movable pointer to a commit. By default you start on main (or master). Create branches to work on features or fixes in isolation:

bash
git branch feature-login
git checkout feature-login
# or in one command:
git checkout -b feature-login

Remotes

A remote is a copy of your repository hosted on a server (GitHub, GitLab, etc.). The default remote after cloning is called origin.

bash
git push origin main
git pull origin main

Next Steps

Practice these commands daily. Start with git init, make some commits, create branches, and push to GitHub. The more you use Git, the more intuitive it becomes.

Chapter 01 · Mental Model & Architecture

Get the complete offline Git Field Guide

The 97-page PDF + ePub course — ₹499. Read this command, offline.

Learn more

Related Git Command References

All 28 commands →

Syntax breakdowns and practical terminal examples for commands used in this topic

More on Git Fundamentals & Setup

All articles →