Git Config Generator
Generate an optimized .gitconfig with identity, default branch, pull rebase, and time-saving aliases.
[init]
defaultBranch = main
[core]
editor = code --wait
autocrlf = input
quotepath = false
[pull]
rebase = true
[push]
autoSetupRemote = true
followTags = true
[fetch]
prune = true
[diff]
algorithm = histogram
colorMoved = default
[credential]
helper = manager
[alias]
co = checkout
br = branch
ci = commit
st = status -sb
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
undo = reset --soft HEAD~1
unstage = restore --staged
amend = commit --amend --no-edit
Do it offline:$
How to use it
- Enter your author name and commit email address (or leave blank to rely on system defaults).
- Configure workflow settings such as pulling with rebase enabled and automatic remote branch pruning.
- Select your preferred diff algorithm (e.g., histogram for clearer code reviews) and credential helper.
- Copy the generated .gitconfig or download it to place in your home directory (~/.gitconfig).
Generate an optimized global or repository .gitconfig file with best-practice workflow flags, credential helpers, histogram diffs, and productive shortcuts.
How it works
Git reads configuration directives from several locations: system-wide, global (~/.gitconfig), and local repository (.git/config).
Enabling 'pull.rebase = true' ensures branch updates are replayed on top of incoming commits rather than generating cluttering merge commits.
The histogram diff algorithm improves code readability in complex refactors by reducing accidental line pairings compared to standard Myers.
All configurations are assembled purely client-side without storing personal names or email addresses.
Examples
Every example on this page is executed against the same engine that powers the tool, on every build.
Gotchas worth knowing
Common errors
FAQ
Where should the generated .gitconfig file be placed?
Place the file at ~/.gitconfig on Linux and macOS, or C:\Users\<Username>\.gitconfig on Windows to apply settings globally across all your repositories.
Why is pull.rebase recommended?
By default, 'git pull' creates unnecessary merge commits when your branch is behind origin. Enabling rebase keeps your local git history linear and easy to audit.
What is the histogram diff algorithm?
Histogram is an improved version of the patience diff algorithm that handles shifted blocks of code better, generating much more human-readable diffs in code reviews.