Skip to content

Instantly share code, notes, and snippets.

@LightCC
Last active October 2, 2022 19:57
Show Gist options
  • Save LightCC/7b8efdd59005dad240b516bedfd0816c to your computer and use it in GitHub Desktop.
Save LightCC/7b8efdd59005dad240b516bedfd0816c to your computer and use it in GitHub Desktop.
A starter .gitconfig file with some basic settings for developing cross-platform code in Windows, with VS Code as the primary IDE for diff/merge. **Note: This requires the VS Code `bin` directory to be on the path.**
[core]
editor = code --wait
autocrlf = input
safecrlf = false
longpaths = true
## Use the below for alternate diff algorithms, see '[diff "slx"]' section below
## This requires the line `*.slx diff=slx` in the referred `.gitattributes` file
# attributesfile = C:/Users/<username>/.gitattributes
[safe]
directory = "*" # Required for all WSL2 repos to work in Windows after Git 2.35.2
[user]
name = <firstname> <lastname> # Replace these without the <> brackets, e.g. `name = John Smith`
email = <emailname@example.com>
[diff]
tool = code
gittool = code
# [diff "slx"]
# textconv = unzip -c -a
[merge]
tool = code
gittool = code
[difftool "code"]
cmd = code --wait --diff \"$LOCAL\" \"$REMOTE\"
# path = code
[mergetool "code"]
cmd = code --wait \"$MERGED\"
# path = code
[pull]
rebase = false
[fetch]
prune = true
[rebase]
autoStash = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment