Working Directory
Staging Area
Local Repository
An ordinary folder
You have a plain project folder with some files. Git is not tracking anything yet.
You have a plain project folder with some files. Git is not tracking anything yet.
Learn Git from beginner to advanced through smooth, interactive animations. Watch commits, branches, merges, rebases, remotes and conflicts transform a repository in real time — the Duolingo of Git.
Turn any folder into a Git repository.
Creates a new, empty Git repository by adding a hidden .git directory that stores all history and configuration.
Copy a remote repository to your machine.
Downloads a complete copy of a remote repository — full history, all branches and a working copy of the files.
See what has changed and what is staged.
Shows the state of your working directory and staging area: which files are untracked, modified, or staged for the next commit.
Move changes into the staging area.
Adds file changes to the staging area (the index), marking exactly what will go into your next commit.
Save staged changes as a new commit.
Permanently records the staged snapshot as a new commit, with a message, author and link to its parent.
Walk backwards through the commit history.
Displays the commit history reachable from HEAD, newest first, with hashes, authors, dates and messages.
See exactly what changed, line by line.
Shows line-level differences between the working directory, the staging area and commits.
Make a new line of development.
Creates a new branch pointer at the current commit so you can develop in isolation without touching main.
Move HEAD onto another branch.
Moves HEAD to another branch and updates your working directory to match that branch.
Switch branches or restore files — the original way.
Historically does many things: switch branches, restore files, and check out specific commits (detaching HEAD).
Combine another branch into the current one.
Integrates the changes from one branch into another, creating a merge commit when the histories have diverged.
Replay commits on top of another branch.
Moves a branch to a new base by replaying its commits one-by-one on top of another commit, producing a linear history.
Copy a single commit onto the current branch.
Applies the changes introduced by one specific commit onto the current branch as a new commit.
Connect your repo to servers like GitHub.
Lists and manages the named connections (remotes) to other copies of your repository, such as origin.
Send your commits to the remote.
Uploads your local commits to a remote branch, sharing your work with others.
Download remote changes without merging.
Downloads new commits and refs from the remote into your remote-tracking branches, without changing your working branch.
Fetch and integrate in one step.
A convenience command that fetches from the remote and then merges (or rebases) the changes into your current branch.
Discard changes or unstage files.
Restores files in your working directory or unstages them, without touching commit history.
Move the branch pointer back — soft, mixed or hard.
Moves the current branch pointer to another commit, optionally rewriting the staging area and working directory.
Undo a commit by adding an inverse commit.
Creates a new commit that reverses the changes of an earlier commit, without deleting history.
Shelve work in progress temporarily.
Saves your uncommitted changes onto a stack and reverts the working directory to a clean state, so you can switch context.
Mark a commit with a memorable name.
Attaches a permanent, human-friendly label (like v1.0.0) to a specific commit, typically to mark releases.
See every move HEAD has made.
Records every change to HEAD (commits, checkouts, resets, rebases), letting you recover "lost" commits.
Binary-search history for the commit that broke things.
Performs a binary search across commits to pinpoint exactly which commit introduced a bug.
Attribute every line to a commit and author.
Shows, for each line of a file, the commit and author that last changed it.
Delete untracked files from the working tree.
Removes untracked files (and optionally directories) from your working directory.
Compress and tidy the object database.
Cleans up unnecessary files and compresses loose objects to optimise the local repository.
Check out several branches at once, side by side.
Lets one repository have multiple working directories, each on a different branch, sharing the same history.
Embed one repository inside another.
Includes another Git repository as a subdirectory, pinned to a specific commit of that repo.
Handle overlapping edits from two branches.
A conflict occurs when two branches change the same lines differently and Git cannot decide automatically. You resolve it by choosing the final content.
Branch, push, open a PR, review, merge.
The standard team workflow: develop on a branch, push it, open a pull request for review, then merge into main.
Contribute to a project you cannot push to.
For open-source or cross-team contributions: you fork the upstream repo, push to your fork, and open a PR back to upstream.
main, develop, feature, release and hotfix branches.
A structured branching model with long-lived main and develop branches plus feature, release and hotfix branches.
Everyone integrates to main constantly.
A model where developers integrate small changes into a single trunk (main) very frequently, using short-lived branches and feature flags.