Git Documentation
Everything you need to learn Git — from your first commit to advanced branching strategies.
What is Git?
Git is a distributed version control system created by Linus Torvalds in 2005 to manage the Linux kernel development. Unlike centralized version control systems (such as SVN or CVS), every developer has a complete copy of the entire repository history on their local machine. This distributed architecture makes Git incredibly fast, allows offline work, and provides robust backup — every clone is a full backup of the repository.
Git has become the de facto standard for version control in software development. It powers GitHub (over 100 million repositories), GitLab, Bitbucket, and nearly every open source project. Understanding Git is an essential skill for every developer, regardless of language or framework.
Core concepts
- Repositories
- A repository (repo) is a directory that Git is tracking. It contains your project files plus a hidden
.gitdirectory that stores the complete history — every commit, branch, tag, and configuration setting. Repositories can be local (on your machine) or remote (hosted on GitHub, GitLab, etc.). - Commits
- A commit is a snapshot of your project at a specific point in time. Each commit has a unique SHA-1 hash, author metadata, timestamp, and a message describing the change. Commits form a directed acyclic graph (DAG) — each commit points to its parent commit, forming the chain of history. This immutable structure is what makes Git history trustworthy.
- Branches
- A branch is a lightweight, movable pointer to a specific commit. Creating a branch is nearly instantaneous because Git does not copy files — it just creates a new pointer. Branches let you develop features, fix bugs, or experiment in isolation. When the work is complete, you merge the branch back into the main line of development.
- The three states
- Git files can be in one of three states: modified (changed but not staged), staged (marked for inclusion in the next commit), or committed (safely stored in the repository). The workflow is: modify files, stage them with
git add, then commit withgit commit.
Getting started
Start by installing Git from git-scm.com. After installation, configure your identity — this is required for commits:
git config --global user.name "Your Name" git config --global user.email "you@example.com" git config --global init.defaultBranch main
Create your first repository with git init, make some changes, stage them, and commit. Practice this workflow until it becomes automatic. Then explore branching, remotes, and the more advanced topics covered in our command reference.
Get the offline Git Field Guide
The 97-page PDF + ePub course — ₹499. Read this command, offline.
Topic clusters & learning paths
Systematic knowledge maps pairing terminal commands with deep-dive guides
Git Fundamentals & Setup
Repository initialization, config, staging, committing, and everyday essentials.
Branching, Merging & Rebasing
Branch lifecycle, merge strategies, rebase workflows, and conflict resolution.
History & Diff Inspection
Formatting logs, commit diffing, author tracing, and repository inspection.
Undoing Mistakes & Disaster Recovery
The complete safety net: safe resets, surgical reverts, reflog recovery, stashing, and cleaning.
Remotes & Team Collaboration
Remote tracking, push/pull dynamics, SSH authentication, submodules, and releases.
Advanced Workflows & Power Tools
Interactive history rewriting, bisect bug hunting, worktrees, and client-side automation hooks.
Continue learning
- Git command referenceAll 28 commands organised by category, with detailed explanations and real-world examples.
- Tutorials & guidesIn-depth articles on Git workflows, branching strategies, hooks, bisect, and more.
- Frequently asked questions18 answers to common questions about Git commands, workflows, and troubleshooting.
- Learning roadmapA structured path from beginner to expert. See what is available now and what is coming next.