git config user.name "Project Identity"Git Config Cookbook
Ready-to-use Git configuration recipes for identity, pull/push policy, aliases, tools, safety, and performance.
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
Identity and UX Defaults
Author, editor, pager, colors, branch names, and output settings.
bash
bash
git config --global core.pager "less -FRX"bash
git config --global color.ui autobash
git config --global init.defaultBranch mainbash
git config --global column.ui autobash
git config --global help.autocorrect promptPull, Push, and Merge Policy
Defaults that shape collaboration and history style.
bash
git config --global pull.ff onlybash
git config --global pull.rebase mergesbash
git config --global rebase.autoStash truebash
git config --global push.default simplebash
git config --global push.autoSetupRemote truebash
git config --global fetch.prune trueDiff and Merge Tools
External diff/merge tool integration.
bash
git config --global merge.tool vscodebash
git config --global mergetool.vscode.cmd 'code --wait "$MERGED"'bash
git config --global difftool.prompt falsebash
git difftool main..feature/my-changebash
git mergetoolUseful Aliases
High-value aliases for faster everyday use.
bash
git config --global alias.lg 'log --oneline --decorate --graph --all'bash
git config --global alias.last 'log -1 HEAD --stat'bash
git config --global alias.unstage 'restore --staged --'bash
git config --global alias.br 'branch -vv'Performance and Safety
Settings for large repos, line endings, and repository trust.
bash
git config --global core.autocrlf truebash
git config --global core.eol lfbash
git config --global gc.auto 256bash
git config --global core.fscache truebash
git config --global --add safe.directory '*'bash
git config --global commit.gpgsign trueMore in Git
Git Patch and Email Workflows
Patch-oriented Git workflows using format-patch, apply, am, and range-diff for mailing-list and review-based collaboration.
Git Internals and Plumbing
Low-level Git objects, refs, trees, index, commit creation, and packfile plumbing for advanced users and debugging.
Git Recovery and Reflog
Git recovery patterns using reflog, ORIG_HEAD, fsck, dangling objects, and targeted reset or cherry-pick flows.
Git Hooks
Git hook locations, setup patterns, and reusable client-side hook snippets for linting, testing, policy, and automation.
Git Revision Syntax
Git revision selectors, ranges, parents, symbolic refs, and object/path addressing.
Git Cheat Sheet
Comprehensive Git commands for day-to-day work, collaboration, history, releases, recovery, and advanced repository workflows.
Recommended next
Docker Swarm Cheat Sheet
DOCKER
Swarm cluster, node, service, and stack commands for container orchestration on Docker Engine.
Docker Buildx Cheat Sheet
DOCKER
Modern BuildKit and Buildx reference for multi-platform builds, cache, secrets, and remote outputs.
Dockerfile Cheat Sheet
DOCKER
High-value Dockerfile instructions, patterns, and build flags for reproducible and efficient image builds.
Docker Cheat Sheet
DOCKER
Comprehensive Docker Engine CLI reference for images, containers, networks, volumes, registries, contexts, and cleanup.