Skip to content

Instantly share code, notes, and snippets.

@marcusholmgren
Last active July 6, 2025 07:05
Show Gist options
  • Save marcusholmgren/ccf2488c7ccf7089ceda4036d7c3ebb0 to your computer and use it in GitHub Desktop.
Save marcusholmgren/ccf2488c7ccf7089ceda4036d7c3ebb0 to your computer and use it in GitHub Desktop.
git configuration
[user]
name = <name>
email = <name>@gmail.com
# Consider adding a signing key for verified commits
# signingkey = <your_gpg_key>
[core]
# For macOS/Linux. Use `true` on Windows.
autocrlf = input
# Set your preferred editor
editor = code --wait
# Use a global .gitignore file
excludesfile = ~/.gitignore_global
[init]
# Set the default branch name for new repositories to `main`
defaultBranch = main
[pull]
# Your existing preference for a linear history, which is great.
rebase = true
[fetch]
# Automatically clean up remote-tracking branches that no longer exist
prune = true
[rebase]
# Automatically stash and re-apply changes when rebasing
autoStash = true
[rerere]
# Your existing setting to reuse recorded conflict resolutions. Excellent choice!
enabled = true
[push]
# Automatically set the upstream branch on the first push to a new branch
autoSetupRemote = true
[alias]
# Your existing aliases are great and retained
ec = config --global -e
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
s = status -s
l = log --oneline --all --graph --decorate
# Modern aliases using `restore` for unstaging/discarding
unstage = restore --staged
discard = restore
# Other useful aliases
co = checkout
br = branch
ci = commit
last = log -1 HEAD
[color]
ui = auto
[help]
# Automatically correct typos in git commands
autocorrect = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment