.gitconfig Generator
Generate a .gitconfig file with user settings, core preferences, aliases, and tool configuration. Copy to your home directory.
Presets:
Configured Editor
vim
Default Branch
main
Config Sections
13 sections
File Size
55 lines (769 B)
About the .gitconfig Generator
The ~/.gitconfig file is read by Git for every operation on your machine. This generator creates a well-structured config with user identity, core settings, and optional aliases likelg (pretty log graph),st (status), and undo (soft reset). Save the output to ~/.gitconfig on Linux/macOS or %USERPROFILE%\.gitconfig on Windows.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Setting up a new machine with the identity, editor and alias settings you always use.
- Producing a config to compare against your current one after inheriting a machine.
- Getting the syntax right for a conditional include that switches identity per directory.
- Generating a starting file before adding work-specific settings by hand.
- Checking which options a tool you just installed expects to be set.
Frequently Asked Questions
- Where do git config settings live?
- Three levels: system-wide, global in `~/.gitconfig`, and per-repository in `.git/config`, with the most specific winning. `git config --list --show-origin` is what tells you which file a surprising setting actually came from.
- What should core.autocrlf be set to?
- `true` on Windows and `input` on macOS and Linux — so the repository stores LF and the working tree gets platform-native endings. A `.gitattributes` file is better still, because it travels with the repo rather than depending on each contributor's setup.
- Why configure pull.rebase?
- Because the default merge creates a merge commit for every pull, cluttering history with commits that record nothing. `pull.rebase = true` replays your local work on top instead, which keeps a linear history — at the cost of rewriting commits you have not pushed.
- What are the most useful aliases?
- Short forms for the commands you type dozens of times — `st` for status, `co` for checkout, and a formatted `lg` for the graph log. The gain is not typing speed; it is that a well-formatted log becomes something you actually look at.
- Should commits be signed?
- Where authorship matters, yes. `commit.gpgsign = true` with a GPG or SSH key produces the verified badge and proves the commit came from you — which matters because the author field is plain text that anyone can set to anything.
Common errors and gotchas
- Setting a global identity and then committing to a work repository with a personal address.
- Assuming global config overrides repository config. Local settings win, which is usually what you want and occasionally surprising.
- Setting the wrong line-ending behaviour for the platform, which shows every file as modified.
- Putting the file in the wrong location, where Git never reads it and the settings appear not to apply.
- Creating an alias that shadows a real Git command, which then behaves unexpectedly for everyone sharing the config.
Related Developer Utilities tools
RegExp Tester
Test regular expressions and inspect matches locally.
Regex Visualizer
Visual regex pattern diagram with live match highlighting and capture group annotations.
Subnet Calculator
Compute CIDR subnets, usable hosts, and network ranges.
Cron Parser
Translate cron syntax into plain English.
URL Parser
Break a URL into protocol, host, path, and query parts.
HTML Previewer
Paste HTML and see it rendered live in a safe, sandboxed preview.
HTTP Status Code Reference
Search and look up every HTTP status code and its meaning.
MIME Type Lookup
Find the MIME type for a file extension, or the extensions for a MIME type.