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.
bashANYconfigidentity
bash
bashANYconfigpager
bash
git config --global core.pager "less -FRX"bashANYconfigcolor
bash
git config --global color.ui autobashANYconfigbranch
bash
git config --global init.defaultBranch mainbashANYconfigui
bash
git config --global column.ui autobashANYconfighelp
bash
git config --global help.autocorrect promptPull, Push, and Merge Policy
Defaults that shape collaboration and history style.
bashANYconfigpull
bash
git config --global pull.ff onlybashANYconfigpullrebase
bash
git config --global pull.rebase mergesbashANYconfigrebase
bash
git config --global rebase.autoStash truebashANYconfigpush
bash
git config --global push.default simplebashANYconfigpush
bash
git config --global push.autoSetupRemote truebashANYconfigfetch
bash
git config --global fetch.prune trueDiff and Merge Tools
External diff/merge tool integration.
bashANYconfigmerge-tool
bash
git config --global merge.tool vscodebashANYconfigmerge-tool
bash
git config --global mergetool.vscode.cmd 'code --wait "$MERGED"'bashANYconfigdifftool
bash
git config --global difftool.prompt falsebashANYdifftool
bash
git difftool main..feature/my-changebashANYmergetool
bash
git mergetoolUseful Aliases
High-value aliases for faster everyday use.
bashANYconfigalias
bash
git config --global alias.lg 'log --oneline --decorate --graph --all'bashANYconfigalias
bash
git config --global alias.last 'log -1 HEAD --stat'bashANYconfigalias
bash
git config --global alias.unstage 'restore --staged --'bashANYconfigalias
bash
git config --global alias.br 'branch -vv'Performance and Safety
Settings for large repos, line endings, and repository trust.
bashWINDOWSconfigline-endings
bash
git config --global core.autocrlf truebashANYconfigline-endings
bash
git config --global core.eol lfbashANYconfiggc
bash
git config --global gc.auto 256bashANYconfigperformance
bash
git config --global core.fscache truebashANYconfigsecuritydanger
bash
git config --global --add safe.directory '*'bashANYconfiggpgsign
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.