Skip to content

Instantly share code, notes, and snippets.

@flcdrg
Last active August 29, 2025 01:10
Show Gist options
  • Save flcdrg/5498e03d8a7afdbfd50430608f1cfeb8 to your computer and use it in GitHub Desktop.
Save flcdrg/5498e03d8a7afdbfd50430608f1cfeb8 to your computer and use it in GitHub Desktop.
Git config (including WSL2)
git config --global core.editor "code --wait"
git config --global fetch.prune true
git config --global push.autoSetupRemote true
git config --global user.email "[email protected]"
git config --global user.name "David Gardiner"
git config --global init.defaultbranch "main"
# Beyond Compare
git config --global diff.tool bc
git config --global difftool.bc.path /mnt/c/Program\ Files/Beyond\ Compare\ 5/BComp.exe
git config --global difftool.bc.cmd "/mnt/c/Program\ Files/Beyond\ Compare\ 5/bcomp.exe \"\$(wslpath -aw \$LOCAL)\" \"\$(wslpath -aw \$REMOTE)\""
git config --global difftool.bc.trustExitCode true
git config --global merge.tool bc
git config --global mergetool.bc.path /mnt/c/Program\ Files/Beyond\ Compare\ 5/BComp.exe
git config --global mergetool.bc.cmd "/mnt/c/Program\ Files/Beyond\ Compare\ 5/bcomp.exe \"\$(wslpath -aw \$LOCAL)\" \"\$(wslpath -aw \$REMOTE)\" \"\$(wslpath -aw \$BASE)\" \"\$(wslpath -aw \$MERGED)\""
git config --global mergetool.bc.trustExitCode true
# Git Credential Manager
git config --global credential.helper manager
git config --global credential.https://dev.azure.com.usehttppath true
# For WSL to use host
git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager.exe"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment