Skip to content

Instantly share code, notes, and snippets.

@PurpleBooth
Last active September 17, 2025 20:30
Show Gist options
  • Save PurpleBooth/8110b6a8cc0f9aebafcfef1086bf8a54 to your computer and use it in GitHub Desktop.
Save PurpleBooth/8110b6a8cc0f9aebafcfef1086bf8a54 to your computer and use it in GitHub Desktop.
Git Setup
#!/usr/bin/env bash
git config --global core.pager delta
git config --global interactive.diffFilter "delta --color-only"
git config --global delta.navigate true
git config --global merge.conflictstyle zdiff3
#!/usr/bin/env bash
# Enable rerere
git config --global rerere.enabled true
# Set default branch to main
git config --global init.defaultBranch main
# Automatically stash changes when rebasing
git config --global rebase.autoStash true
# Autosquash marked commits with fixup
git config --global rebase.autoSquash true
# Rebase rather than making merge commits
git config --global pull.rebase true
# Include the commit message below the message template when committing
git config --global commit.verbose true
# More sensible diffs
git config --global diff.algorithm histogram
# No more stupid having to do "-u" on push
git config --global push.autoSetupRemote true
# Occasionally optimise the repository
git config --global maintenance.strategy incremental
# When you rebase a branch, also rebase the branches that were branched off by this branch, rather than just the branch (branch)
git config --global rebase.updateRefs true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment