Skip to content

Instantly share code, notes, and snippets.

@leek
Created August 26, 2025 17:04
Show Gist options
  • Select an option

  • Save leek/b9d2c41d3caccba308b7750b7d97bd50 to your computer and use it in GitHub Desktop.

Select an option

Save leek/b9d2c41d3caccba308b7750b7d97bd50 to your computer and use it in GitHub Desktop.
~/.gitconfig
[core]
excludesfile = ~/.gitignore
editor = subl -n -w
# pager = diff-so-fancy | less -r
autocrlf = input
#[include]
# path = ~/.gitconfig.local
[alias]
cp = cherry-pick
st = status -s
cl = clone
ci = commit
co = checkout
br = branch
diff = diff --word-diff
dc = diff --cached
dt = difftool
unstage = reset HEAD --
unadd = reset HEAD --
remove-missing = "!git ls-files --deleted -z | xargs -0 git update-index --remove"
tags = tag -l
branches = branch -a
ours = "!f() { files=\"$@\"; [ -z $files ] && files='.'; git checkout --ours -- $files; git add -u $files; }; f"
theirs = "!f() { files=\"$@\"; [ -z $files ] && files='.'; git checkout --theirs -- $files; git add -u $files; }; f"
rename = mv
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
undo = reset --hard HEAD~1
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
[color]
ui = true
branch = auto
diff = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
commit = green bold
frag = magenta bold
old = red bold
new = green bold
whitespace = red reverse
[color "status"]
added = yellow
changed = green
untracked = cyan
[pager]
color = true
[push]
default = current
[merge]
log = true
tool = ksdiff
stat = true
renormalize = true
[mergetool]
prompt = false
keepBackup = true
[mergetool "ksdiff"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
[rerere]
enabled = true
autoupdate = true
[diff]
tool = ksdiff
guitool = ksdiff
renames = copies
mnemonicprefix = true
colorMoved = zebra
[difftool]
prompt = false
[difftool "ksdiff"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[difftool "difftastic"]
cmd = difft "$LOCAL" "$REMOTE"
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[advice]
pushNonFastForward = false
statusHints = false
[branch]
autosetupmerge = true
[help]
autocorrect = 1
#[credential]
# helper = osxkeychain
[filter "media"]
clean = git-media-clean %f
smudge = git-media-smudge %f
[filter "hawser"]
clean = git hawser clean %f
smudge = git hawser smudge %f
required = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[pull]
rebase = merges
[delta]
navigate = true # Use n and N to move between diff sections.
light = false # Set to `true` if you prefer light themes.
side-by-side = true # Enables the side-by-side view.
[fetch]
prune = true
prunetags = true
[init]
defaultBranch = main
# Global/Archives
# It's better to unpack these files and commit the raw source because
# git has its own built in compression methods.
*.7z
*.jar
*.rar
*.zip
*.gz
*.gzip
*.tgz
*.bzip
*.bzip2
*.bz2
*.xz
*.lzma
*.cab
*.xar
# Packing-only formats
*.iso
*.tar
# Package management formats
*.dmg
*.xpi
*.gem
*.egg
*.deb
*.rpm
*.msi
*.msm
*.msp
*.txz
# Global/Backup
*.bak
*.gho
*.ori
*.orig
*.tmp
# Global/Linux
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
# Global/SublimeText
# Cache files for Sublime Text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
# Workspace files are user-specific
*.sublime-workspace
# Project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using Sublime Text
# *.sublime-project
# SFTP configuration file
sftp-config.json
sftp-config-alt*.json
# Package control specific files
Package Control.last-run
Package Control.ca-list
Package Control.ca-bundle
Package Control.system-ca-bundle
Package Control.cache/
Package Control.ca-certs/
Package Control.merged-ca-bundle
Package Control.user-ca-bundle
oscrypto-ca-bundle.crt
bh_unicode_properties.cache
# Sublime-github package stores a github token in this file
# https://packagecontrol.io/packages/sublime-github
GitHub.sublime-settings
# Global/Vagrant
# General
.vagrant/
# Log files (if you are creating logs in debug mode, uncomment this)
# *.log
# Global/VisualStudioCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
# Local History for Visual Studio Code
.history/
# Built Visual Studio Code Extensions
*.vsix
# Code Workspace
*.code-workspace
# Global/Windows
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# Global/macOS
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
# Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment