Pages

Topics

Tools

↑↓navigate↵openescclose

Git guides

Every published Git guide, newest first, with practical examples you can copy into your own project.

3,815 guides across 14 topics

Topics

Latest Git guides

3D illustration of a repository cube sweeping fragments into a bin while a rewritten history ribbon replaces the old
Git

Git clean, gc, and filter-repo: Removing Sensitive History

clean deletes untracked files with no undo, gc compacts objects, filter-repo rewrites every hash. Removing a secret means rotating it first and re-cloning afterwards.

GitSecurityHistoryMaintenance
3D illustration of a gear panel with shortcut chips wired into a keyring held by a locker
Git

Git config: Aliases, rerere, and Credential Helpers

Five config scopes decide one value at a time. Aliases are user-level shorthand, rerere records conflict resolutions, and credential helpers choose where your secret lives.

GitConfigurationAliasesCredentials
3D illustration of commit blocks rolling through check gates on a conveyor before a commit tray
Git

Git Hooks: pre-commit, commit-msg, and Husky Automation

Hooks live in .git/hooks, which a clone never receives, so core.hooksPath and Husky are how they travel. Exit codes abort the operation, and every hook is bypassable.

GitHooksHuskyAutomation
3D illustration of file cards passing a filter gate while ignored cards fall into a bin
Git

Git ignore: Patterns, Negation, and Untracking Cached Files

Patterns are relative and last match wins, but a negation cannot revive a file inside an excluded directory. Ignore rules never touch tracked files: rm --cached first.

GitGitignoreConfigurationCLI
3D illustration of a parent repository cube containing a nested repository cube beside a vendored copy
Git

Git Submodules vs Subtree: Cloning, Updating, and Removal

A submodule records a commit hash and needs an extra init step everywhere; a subtree copies files into your history. The comparison that decides which friction you want.

GitSubmodulesSubtreeDependency
3D illustration of one repository cube with three working folder slabs branching off
Git

Git worktree: Multiple Checked-Out Branches in One Repository

A linked worktree has its own HEAD, index, and files while sharing objects and refs. One branch per worktree, prune for deleted directories, and submodules that stay empty.

GitWorktreeBranchingCLI
3D illustration of a row of commit cubes with a halving search path narrowing to one red faulty cube
Git

Git bisect: Binary Search, Automated Scripts, and Bug Hunting

Mark one bad and one good commit and Git halves the range each step. bisect run automates it through exit codes, and monotonicity is the assumption that must hold.

GitBisectDebuggingCLI
3D illustration of a commit timeline with a plain tag plate and a sealed annotated tag block
Git

Git Tags: Lightweight vs Annotated and SemVer Release Tags

An annotated tag stores the tagger, date, and message; describe and --follow-tags only use those. How v:refname sorting and versionsort.suffix fix pre-release order.

GitTagsReleaseSemVer
3D illustration of a local repository cube pushing commit blocks through a locked lease gate to a remote cube
Git

Git push: --force-with-lease, Tags, and Deleting Remote Branches

A lease compares against your tracking ref, so a background fetch can silently pass it. Pinning the hash or --force-if-includes closes the hole; tags need their own push.

GitPushRemoteRelease
3D illustration of a cloud remote cube sending commit blocks down a pipe to a local repository cube
Git

Git fetch, pull, rebase, and prune: Syncing Remote Branches

fetch moves tracking refs, pull merges or rebases on top, prune removes branches deleted upstream. Why pull now stops on divergent history, and what --ff-only protects.

GitFetchPullRemote