Git Help Center & Living Cheat Sheet
Query any command in the smart help terminal or browse the living cheat sheet to see what every command does, its syntax, and realistic execution output.
Smart Help Terminal
Auto-types syntax, explanation & realistic outputgit init
Creates a hidden `.git` directory inside the current folder containing the object store, ref pointers (HEAD), configuration file, and hooks infrastructure.
Living Git Cheat Sheet Matrix
Quick syntax reference with 1-click execution & output simulation.
git initInitializes a brand new, empty local Git repository.
Creates a hidden `.git` directory inside the current folder containing the object store, ref pointers (HEAD), configuration file, and hooks infrastructure.
git cloneClones a remote repository into a newly created local directory.
Copies the complete commit history, objects, and refs from a remote URL, checks out the default branch, and configures `origin` as the remote pointer.
git configGets and sets repository or global configuration options.
Writes key-value preferences to local (`.git/config`), global (`~/.gitconfig`), or system configuration files (e.g. username, email, editor, aliases).
git statusDisplays working tree and staging index status.
Compares the three Git zones (Working Tree vs Index vs HEAD) to report untracked files, staged changes, unstaged modifications, and branch sync status.
git addAdds file contents to the staging area (index).
Reads file data from the Working Tree, creates SHA-1/SHA-256 blob objects in the `.git/objects` database, and records their paths in `.git/index`.
git commitRecords snapshots of the staged index changes to the repository history.
Packages the staged tree structure into a permanent cryptographically hashed Commit object, links it to current parent commit, and advances the current branch pointer.
git branchLists, creates, renames, or deletes branches.
Manages pointer references in `.git/refs/heads/`. A Git branch is merely a 41-byte text file storing the 40-character SHA of a commit.
git switchSwitches branches and updates working directory files.
Points the `HEAD` reference to another branch and updates files in the Working Tree and Staging Area to match the target commit snapshot.
git mergeJoins two or more development histories together.
Finds the best common ancestor commit between current branch and target branch, creates a three-way diff, and creates a new merge commit (or fast-forwards).
git rebaseReapplies commits on top of another base tip.
Calculates patch diffs for current branch commits, rewinds to common ancestor with target base, and re-executes each commit sequentially to produce a clean linear history.
git logShows commit logs and cryptographic lineage.
Traverses parent pointers starting from HEAD backward in time, displaying author, date, message, and commit hashes.
git diffShow changes between commits, commit and working tree, etc.
Computes line-by-line unified diffs comparing files between Working Tree, Staging Area, or between two arbitrary commit SHAs.
git reflogManages and displays reference log information.
Records every single time the HEAD pointer moved in your local repository (commits, resets, checkouts, merges, rebases). Your ultimate undo safety net.
git restoreRestores working tree files or staging area.
Modern command (Git 2.23+) designed specifically to discard uncommitted working changes or unstage files without touching commit history.
git resetResets current HEAD to the specified state.
Moves the current branch pointer backward to an earlier commit, with flags controlling whether index and working tree are preserved or wiped.
git revertReverts existing commits by creating an inverse commit.
Generates a brand-new commit that applies the exact inverse mathematical diff of a specified bad commit, making it safe for public shared branches.
git stashStashes changes in a dirty working directory away.
Takes all modified tracked files and staged changes, saves them as a temporary shelf object in `.git/refs/stash`, and reverts your working tree to clean HEAD state.
git fetchDownloads objects and refs from another repository.
Contacts remote server (`origin`), downloads any new commits and branches, and updates remote-tracking references (`origin/main`) without modifying your local working files.
git pullFetches from and integrates with another repository or a local branch.
Combines `git fetch` followed immediately by `git merge FETCH_HEAD` (or `git rebase` if configured).
git pushUpdates remote refs along with associated objects.
Sends local commit objects and packfiles to the remote repository and advances the corresponding branch reference on the server.