Skip to content

Instantly share code, notes, and snippets.

@PAHeartBeat
Created August 7, 2025 09:00
Show Gist options
  • Select an option

  • Save PAHeartBeat/9f75bb3d17e904b4d57551e8e0ebbfda to your computer and use it in GitHub Desktop.

Select an option

Save PAHeartBeat/9f75bb3d17e904b4d57551e8e0ebbfda to your computer and use it in GitHub Desktop.
sample .gitconfig to use multiple diff/merge tool like p4v, code, jdjson, unityYAMLMerger
[user]
email = [email protected]
name = Ankur Ranpariya
signingKey =
[gpg]
format = openpgp
program = gpg
[commit]
gpgSign = true
template = /Users/ipaheartbeat/.stCommitMsg
[tag]
forceSignAnnotated = true
gpgsign = true
[gpg "ssh"]
program = ssh-keygen
allowedSignersFile = /Users/ipaheartbeat/.ssh/allowed_signers
[core]
# Mac
# excludesfile = /Users/ipaheartbeat/.gitignore_global
# editor = code --wait
# Windows
editor = code --wait
excludesfile = C:\\Users\\Ankur\\Documents\\gitignore_global.txt
[difftool "sourcetree"]
path =
# Mac
# cmd = /Applications/p4merge.app/Contents/MacOS/p4merge \"$LOCAL\" \"$REMOTE\"
# Windows
cmd = 'C:/Program Files/Perforce/p4merge.exe' \"$LOCAL\" \"$REMOTE\"
[mergetool "sourcetree"]
trustExitCode = true
keepBackup = false
# Mac
# cmd = /Applications/p4merge.app/Contents/MacOS/p4merge \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
# Windows
cmd = 'C:/Program Files/Perforce/p4merge.exe' \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
[difftool "code"]
path =
# Mac
cmd = code \"$LOCAL\" \"$REMOTE\"
# Windows
cmd = code --diff \"$LOCAL\" \"$REMOTE\"
[mergetool "code"]
# Mac
# cmd = /Applications/Visual Studio Code.app/Contents/MacOS//Electron \"$LOCAL\" \"$BASE\" \"$REMOTE\" \"$MERGED\"
# Windows
# cmd = 'C:/Users/Ankur/AppData/Local/Programs/Microsoft VS Code/bin/code' \"$LOCAL\" \"$BASE\" \"$REMOTE\" \"$MERGED\"
cmd = code \"$LOCAL\" \"$BASE\" \"$REMOTE\" \"$MERGED\"
trustExitCode = true
[mergetool "unityyamlmerge"]
# Mac
# cmd = /Applications/Unity/Hub/Editor/6000.0.23f1/Unity.app/Contents/Tools/UnityYAMLMerge merge -p \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
# Windows
cmd = 'C:/Program Files/Unity/Hub/Editor/6000.0.49f1/Editor/Data/Tools/UnityYAMLMerge' merge -p \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
trustExitCode = true
[mergetool "jdjson"]
# Mac
# cmd = /opt/homebrew/Cellar/jd/1.9.1/bin/jd -f merge \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
# Windows
# cmd = /opt/homebrew/Cellar/jd/1.9.1/bin/jd -f merge \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
trustExitCode = true
[difftool "jdjson"]
# Mac
# cmd = /opt/homebrew/Cellar/jd/1.9.1/bin/f \"$LOCAL\" \"$REMOTE\"
# Windows
# cmd = /opt/homebrew/Cellar/jd/1.9.1/bin/f \"$LOCAL\" \"$REMOTE\"
path =
[credential]
helper = store
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[diff "lfs"]
textconv = cat
[init]
defaultBranch = master
[lfs]
pruneverifyremotealways = true
[pull]
rebase = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment