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 .git directory 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). This three-state model is what gives Git its fine-grained control over commits. The workflow is: modify files, stage them with git add, then commit with git 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.
Git Command Reference
Explore all 28 commands organized by category with detailed explanations and real-world examples.
Browse commands →Tutorials & Guides
In-depth articles on Git workflows, branching strategies, hooks, bisect, and more.
Read tutorials →Frequently Asked Questions
18 answers to common questions about Git commands, workflows, and troubleshooting.
View FAQ →Learning Roadmap
A structured path from beginner to expert. See what is available now and what is coming next.
View roadmap →