Command Hub

Git Command Topics

Start from the command hub, then move into focused command details without overloading the sidebar with a flat list.

Command Hub

Recommended Sequence

Start with inspection, commit, and sync, then move into commands that rewrite history, recover state, or debug regressions.

Command Hub

Representative Topics

If you want the essence of the command channel first, start with status awareness, history shaping, and recovery entry points.

Command Reference

Core Commands

Start with the everyday commands for repository setup, inspection, committing, syncing, and branch movement.

git init Tutorial

Explains how git init creates a repository, how the initial branch is defined, and how it is used for both new and existing directories.

git clone Tutorial

Explains how git clone copies a repository, what origin means by default, and what local branch setup usually looks like after cloning.

git status Tutorial

Covers how git status shows working tree, staging area, and branch state, and why it should be part of nearly every Git workflow.

git add Tutorial

Explains how git add stages changes for the next commit, how patch staging works, and how to avoid mixing unrelated edits into one commit.

git commit Tutorial

Explains how git commit creates new history nodes, how to write stronger messages, and when amend is safe versus risky.

git diff Tutorial

Explains how git diff compares working tree, index, and commit states, how to read the most useful forms, and how to avoid checking the wrong layer.

git show

Inspect a specific commit, tag, or object in detail, making it one of the most useful commands for reading history precisely.

git log Tutorial

Shows how git log inspects commit history, graph structure, authorship, and filtered history for debugging, review, and recovery.

git rm

Remove tracked files and stage that removal, which makes it easier to separate filesystem deletion from Git history changes.

git mv

Rename or move tracked files while keeping the index in sync, which makes large refactors easier to stage consistently.

git fetch Tutorial

Explains how git fetch updates remote refs, why it is often safer than pull, and where it fits in a daily sync workflow.

git pull Tutorial

Explains git pull as fetch plus integration, when pull is convenient, when fetch-first is safer, and how rebase or ff-only change the outcome.

git push Tutorial

Explains how git push publishes local branches, how upstream tracking works, and how to reason about safe versus risky publication.

git switch Tutorial

Introduces git switch as the dedicated branch-switching command and clarifies how it differs from checkout.

git branch Tutorial

Covers how git branch lists, creates, renames, and deletes branches, and how it relates to remote-tracking branches.

git tag Tutorial

Introduces git tag for release points, explains lightweight versus annotated tags, and covers basic tag publishing.

git remote Tutorial

Explains how git remote lists, adds, renames, and removes remote definitions, and how origin fits into common collaboration flows.

git-config Tutorial

Explains how to use git-config to inspect and edit Git configuration.

git-help Tutorial

Explains how to use git-help to open command help and man pages.

git-describe Tutorial

Explains how to use git-describe to describe a commit by the nearest reachable tag.

git-grep Tutorial

Explains how to use git-grep to search text inside the repository.

git-shortlog Tutorial

Explains how to use git-shortlog to summarize commit history by author and subject.

git-show-ref Tutorial

Explains how to use git-show-ref to list refs and the objects they point to.

git-rev-parse Tutorial

Explains how to use git-rev-parse to parse revision expressions and repository path details.

Command Reference

Advanced Commands

Then move into commands that affect history shape, undo strategy, and operational risk.

git rebase Tutorial

Explains the core model of git rebase, recommended workflows, risks, and recovery options.

git merge Tutorial

Explains the purpose of git merge, the difference between fast-forward and merge commits, and how to handle conflicts.

git cherry-pick Tutorial

Explains how to apply a selected commit onto the current branch and when cherry-pick is the right tool.

git reset Tutorial

Explains how git reset moves HEAD, updates the index, and optionally overwrites the working tree through soft, mixed, and hard modes.

git stash Tutorial

Explains how to temporarily shelve local changes with git stash and later inspect, restore, or remove stash entries.

git restore Tutorial

Explains how git restore recovers file state in the working tree or index, and how it differs from reset and checkout.

git revert Tutorial

Explains why git revert is the safe way to undo shared commits, and how it differs from reset at the history level.

git reflog

Read reference movement history, which makes reflog one of the most important commands for recovery after reset, rebase, and branch mistakes.

git bisect

Use binary search across history to locate the commit that introduced a regression, making it one of the most valuable debugging commands in Git.

git blame

Track which commit last changed each line in a file, making it useful for recovering context around why a line looks the way it does now.

git checkout Tutorial

Explains git checkout as the older multi-purpose command for branch switching and path restoration, and how it relates to switch and restore.

git clean Tutorial

Explains how git clean removes untracked files and directories, and why dry-run and force flags are essential here.

git-am Tutorial

Apply mailbox patch series as real commits, preserving author/message metadata in patch-by-email workflows.

git-apply Tutorial

Explains how to use git-apply to apply patch content to the working tree or index.

git-format-patch Tutorial

Explains how to use git-format-patch to export commits as patch files.

git-send-email Tutorial

Send patch series produced by `format-patch` through email while preserving commit boundaries and thread context.

git-request-pull Tutorial

Generate a pull summary that tells maintainers what to fetch from which base and branch, useful in email-driven or traditional maintainer workflows.

git-archive Tutorial

Explains how to use git-archive to export an archive from a commit or tree object.

git-bundle Tutorial

Package Git history into a single transferable file for offline or restricted-network exchange when direct fetch/push is unavailable.

git-worktree Tutorial

Create parallel working directories for one repository to reduce stash/switch friction and improve multi-task flow.

git-submodule Tutorial

Manage external repository pointers inside a parent repository, with emphasis on committing submodule pointer updates in the superproject.

git-sparse-checkout Tutorial

Explains how to use git-sparse-checkout to check out only selected paths from a repository.

git-cat-file Tutorial

Explains how to use git-cat-file to inspect Git object types and contents directly.

git-ls-files Tutorial

Explains how to use git-ls-files to list tracked paths from the index and working tree.

git-ls-tree Tutorial

Explains how to use git-ls-tree to list entries inside a tree object.

git-read-tree Tutorial

Explains how to use git-read-tree to read tree objects into the index for lower-level operations.

git-update-index Tutorial

Explains how to use git-update-index to update index entries and attributes directly.

git-update-ref Tutorial

Explains how to use git-update-ref to update refs through a lower-level interface.

git-symbolic-ref Tutorial

Explains how to use git-symbolic-ref to read or update symbolic refs such as HEAD.

git-rev-list Tutorial

Explains how to use git-rev-list to enumerate commit sets in a script-friendly way.

git-merge-base Tutorial

Explains how to use git-merge-base to find the best common ancestor between histories.

git-notes Tutorial

Attach audit or review annotations to commits without rewriting commit objects, useful when teams need extra context without history mutation.

git-range-diff Tutorial

Compare two patch series (not just final file states), especially useful after rebase or commit reshaping when reviewers ask what changed between v1 and v2.

git-cherry Tutorial

Explains how to use git-cherry to check which commits have not yet been integrated elsewhere.

git-mergetool Tutorial

Explains how to use git-mergetool to launch an external merge tool for conflict resolution.

git-fsck Tutorial

Explains how to use git-fsck to verify the integrity of objects and refs.

git-gc Tutorial

Explains how to use git-gc to run garbage collection and housekeeping.

git-count-objects Tutorial

Explains how to use git-count-objects to count loose objects and pack usage.

git-verify-pack Tutorial

Explains how to use git-verify-pack to inspect objects stored inside a pack file.

git-verify-tag Tutorial

Explains how to use git-verify-tag to verify signed tag authenticity.

git-rerere Tutorial

Enable and reuse conflict resolutions to reduce repeated manual work for the same conflicts.

git-difftool Tutorial

Use an external graphical tool to view diffs, improving code review and conflict comprehension efficiency.

git-replace Tutorial

Replace a commit object without rewriting history, useful for repository splitting or fixing specific nodes in history.

git-prune Tutorial

Clean up unreachable Git objects, working with gc and reflog to manage repository object lifecycle.

git-hash-object Tutorial

Compute the Git object ID (SHA-1) for a file or stdin, helping understand Git's content-addressing model.

git-interpret-trailers Tutorial

Parse, add, or normalize trailer fields in commit messages, such as Co-authored-by and Signed-off-by.