Avoid double quotes in git config from cmd

I want to create a batch file that initializes all the keys / values ​​in my .gitconfig file.

I am having problems installing the following section from cmd:

 [mergetool "p4merge"] cmd = p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED" 

I tried:

 git config --global mergetool.p4merge.cmd "p4merge \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"" 

But the result:

 [mergetool "p4merge"] cmd = p4merge \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\" 

How to avoid these double quotes from cmd?

+7
git cmd
source share
1 answer

Git answer on Windows: how do you configure mergetool? "offers:

  • From a git bash session:
 git config --global mergetool.p4merge.cmd 'p4merge.exe \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"' 
  • or from the windows cmd.exe shell:
 git config --global mergetool.p4merge.cmd "p4merge.exe \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"" 

So if you run git-bash.bat or git-cmd.bat

+4
source share

All Articles