git initInitialize a new Git repository in the current directory.
basics git cloneClone a remote repository to your local machine.
basics git addStage changes for the next commit.
basics git commitRecord staged changes in the repository history.
basics git statusShow the working tree status and staged changes.
basics git rmRemove files from the working tree and the index.
basics git mvMove or rename a file, directory, or symlink.
basics git restoreRestore working tree files from a source.
basics git cleanRemove untracked files from the working tree.
basics git showShow details of a commit, tag, or other object.
basics git tagCreate, list, delete, or verify tags.
basics git archiveCreate an archive of files from a named tree.
basics git shortlogSummarize git log output grouped by author.
basics git branchList, create, or delete branches.
branching git checkoutSwitch branches or restore working tree files.
branching git switchSwitch branches (modern alternative to checkout).
branching git mergeJoin two or more development histories together.
branching git cherry-pickApply changes from specific commits onto the current branch.
branching git worktreeManage multiple working trees for the same repo.
branching git branch --set-upstream-toSet the upstream tracking branch for the current branch.
branching git merge-baseFind the best common ancestor between commits.
branching git remoteManage the set of tracked remote repositories.
remote git fetchDownload objects and refs from a remote repository.
remote git pullFetch from remote and integrate with local branch.
remote git pushUpload local commits to a remote repository.
remote git push --forceForce push local branch overwriting remote history. Use with extreme caution.
remote git remote pruneRemove stale remote-tracking branches.
remote git ls-remoteList references in a remote repository.
remote git submoduleInitialize, update, or inspect submodules.
remote git bundleMove objects and refs by archive for offline transfer.
remote git stashTemporarily save uncommitted changes and clean working directory.
stash git stash popApply the most recent stash and remove it from the stash list.
stash git stash applyApply a stash without removing it from the stash list.
stash git stash listList all stashed changesets.
stash git stash dropRemove a specific stash entry from the list.
stash git stash clearRemove all stash entries. Cannot be undone.
stash git stash showShow the diff of a stash entry.
stash git stash branchCreate a new branch from a stash and apply it.
stash git stash pushStash specific files or paths (modern syntax).
stash git logShow the commit history for the current branch.
log git log --prettyFormat log output with custom format strings.
log git log --sinceShow commits from a specific date range.
log git log -pShow commit history with full diffs (patches).
log git log --grepSearch commit messages for a pattern.
log git reflogShow history of HEAD changes including resets and rebases.
log git blameShow who last modified each line of a file.
log git bisectUse binary search to find the commit that introduced a bug.
log git log -SSearch for commits that added or removed a string (pickaxe).
log git whatchangedShow commit logs with raw diff output per commit.
log git rev-listList commit objects in reverse chronological order.
log git diffShow unstaged changes between working tree and index.
diff git diff --stagedShow changes staged for the next commit.
diff git diff HEADShow all changes (staged + unstaged) vs last commit.
diff git diff <branch1>..<branch2>Show differences between two branches.
diff git diff <commit1> <commit2>Show differences between two specific commits.
diff git difftoolLaunch an external diff tool for visual comparison.
diff git diff --word-diffShow word-level differences instead of line-level.
diff git diff --checkWarn about whitespace errors (trailing spaces, mixed indent).
diff git diff --shortstatShow only the summary line of a diff.
diff git diff --name-statusShow file names with change type (A/M/D/R).
diff git range-diffCompare two commit ranges (e.g., before/after rebase).
diff git resetReset current HEAD to a specified state.
reset git reset --softMove HEAD back but keep all changes staged for recommit.
reset git reset --hardCompletely discard all changes and reset to a commit. DESTRUCTIVE.
reset git reset --mixedUnstage changes but keep them in working directory (default).
reset git revertCreate a new commit that undoes changes from a previous commit.
reset git checkout -- <file>Discard unstaged changes to a specific file.
reset git restore --stagedUnstage a file without discarding changes.
reset git reset HEAD <file>Unstage a specific file (legacy way).
reset git reflog + resetRecover lost commits using reflog history.
reset git update-refSafely update a ref to a new value.
reset git rebaseReapply commits on top of another base commit.
rebase git rebase -iInteractive rebase to squash, reorder, or edit commits.
rebase git rebase --ontoTransplant a branch onto a different base.
rebase git rebase --autosquashAutomatically reorder fixup!/squash! commits during interactive rebase.
rebase git rebase --autostashAutomatically stash and unstash changes around rebase.
rebase git commit --fixupCreate a fixup commit for use with rebase --autosquash.
rebase git rebase --execRun a command after each rebased commit (e.g., run tests).
rebase git pull --rebaseFetch and rebase local commits on top of upstream changes.
rebase git configGet and set repository or global options.
config git config user.nameSet or get the author name for commits.
config git config user.emailSet or get the author email for commits.
config git config core.editorSet the default text editor for Git.
config git config core.autocrlfConfigure line ending conversion behavior.
config git config aliasCreate custom Git command shortcuts.
config git config pull.rebaseSet default pull strategy to rebase instead of merge.
config git config --listShow all Git configuration settings in effect.
config git config init.defaultBranchSet the default branch name for new repositories.
config git config credential.helperConfigure credential storage for authentication.
config git config diff.toolSet the default external diff tool.
config git config merge.conflictstyleChange how merge conflicts are displayed.
config git config rerere.enabledEnable recorded resolutions to auto-resolve repeated conflicts.
config