Last active
October 8, 2026 21:00
-
-
Save xim/a0f854bce5ceb89ef4703b00894ece76 to your computer and use it in GitHub Desktop.
Git config, annotated for your reading pleasure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [user] | |
| # Your name is, most certainly, Morten Minde Neergaard | |
| name = Morten Minde Neergaard | |
| # I sign my commits using GPG. | |
| signingkey = 540BA9A370483F70 | |
| # Prevents git from "guessing" an email address. It'll be wrong. | |
| useConfigOnly = true | |
| # I usually don't configure my email globally, but per-repo, because I have | |
| # both a work email and a personal github. | |
| # email = 169057+xim@users.noreply.github.com | |
| [alias] | |
| # Just because I've used those in other VCS | |
| co = checkout | |
| ci = commit | |
| st = status -s | |
| # E.g. for "vim `git changed`" or "vim `git changed HEAD^^..HEAD`" | |
| changed = diff --name-only | |
| unmerged = diff --diff-filter=U --name-only | |
| untracked = ls-files --others --exclude-standard | |
| # Pretty-ish graph over commit history, including branches and tags | |
| logtree = log --oneline --graph --decorate --all | |
| # Just a silly example of an external command alias. Generates a graphviz | |
| # dot digraph of the commit history... Generally useless xD | |
| graphviz = "! echo 'digraph git {' ; git log --pretty='format: %h -> { %p }' \"$@\" | sed 's/[0-9a-f][0-9a-f]*/\"&\"/g' ; echo '}'" | |
| # Keep commit, keep changes, but let me re-add files. Hady if a `git commit -a` went overly-wide. | |
| uncommit = !git reset HEAD^ && git commit --no-gpg-sign --allow-empty -C ORIG_HEAD | |
| [help] | |
| # Allows me to write "git psuh", "git logg" or whatever, and get a tiny bit | |
| # of "do what I mean" behavior | |
| autocorrect = 1 | |
| [color] | |
| # Coloring is pretty much required. Makes things more readable. | |
| ui = auto | |
| [core] | |
| # Relevant for Windows projects, mostly | |
| autocrlf = input | |
| # Warn about mixed line endings, generally relevant in said Windows projects | |
| safecrlf = warn | |
| # Lets you override hooks for any and all repoes | |
| hooksPath = ~/.githooks | |
| [sendemail] | |
| # If you want to send patches by email. Generally not used at Cisco anymore | |
| smtpserver = /usr/sbin/sendmail | |
| [push] | |
| # By default, push the current branch to a branch of the same name on the remote | |
| # (This is the default in newer git versions, but not in older ones) | |
| default = simple | |
| # When pushing, if the remote branch doesn't exist, create it and set it up | |
| # as the tracking branch if you don't have one already. Typically correct. | |
| autoSetupRemote = true | |
| [stash] | |
| # Make "git stash show" show the actual diff without needing "--patch" | |
| showPatch = true | |
| [github "sqbu-github.cisco.com/api/v3"] | |
| # Used by the "gh" CLI tool, not by git itself. You can have different | |
| # usernames for different github instances. | |
| user = mneergaa | |
| [diff] | |
| # When showing diffs, distinguish moved lines with a different color | |
| colorMoved = zebra | |
| # Ignore whitespace changes when determining whether a line has moved | |
| colorMovedWs = allow-indentation-change | |
| [color "diff"] | |
| # Defaults are, like, a friggin' rainbow. This is very subdued. | |
| oldMoved = cyan | |
| oldMovedAlternative = dim cyan | |
| newMoved = bold cyan | |
| newMovedAlternative = dim bold cyan | |
| [advice] | |
| # Don't warn verbosely about dropped cherry-picks in a rebase. The | |
| # non-verbose message (which is still shown) is enough. | |
| skippedCherryPicks = false | |
| [commit] | |
| # If you want to actually sign using the above-specified GPG key | |
| gpgsign = true | |
| [init] | |
| # When you run "git init", avoid warning about changed default master->main | |
| defaultBranch = main | |
| [rerere] | |
| # After resolving a conflict during a rebase or merge, git can record the | |
| # resolution and auto-apply it if the same conflict arises again. Magic! | |
| enabled = true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment