Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
1
Question by guiquadros · Mar 18, 2017 at 09:02 AM · visual studiomergegithub

Unity Smart Merge (UnityYAMLMerge.exe): how to configure vsDiffMerge.exe in the mergespecfile.txt?

Hello,

I am using GitHub as my repository and I want to use vsDiffMerge.exe as my fallback merge tool. I tried to configure it in mergespecfile.txt as:

* use "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\vsdiffmerge.exe" "$LOCAL" "$REMOTE" "$BASE" "$MERGED" //m

and as:

* use "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\vsdiffmerge.exe" "%r" "%l" "%b" "%d"

The first command does not work at all. The second command does just the diff (not the merge operation - more information here) and I tried to add the //m in the end, but same thing, it just does the diff.

In SourceTree, I have the UnityYAMLMerge.exe correctly configured:

Merge Tool = Custom

Diff command = C:\Program Files\Unity\Editor\Data\Tools\UnityYAMLMerge.exe

Arguments = merge -p "$BASE" "$REMOTE" "$LOCAL" "$MERGED"

The YAML merge (scene and prefabs) works well, but the problem is to launch the fallback tool for scripts.

By the way, if I configure the vsDiffMerge.exe directly in SourceTree like below it works well for the scripts (but for YAML not of course - I want to use the UnityYAMLMerge.exe for prefabs and scenes as the default merge tool, not vsDiffMerge.exe):

Merge Tool = Custom

Diff command = C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\vsdiffmerge.exe

Arguments = "$LOCAL" "$REMOTE" "$BASE" "$MERGED" //m

Nowadays, I keep switching between those configurations in SourceTree (when I need to merge scripts I put vsDiffMerge.exe, when I need to merge YAML I put UnityYAMLMerge.exe), but this is not productive and the mergespecfile.txt should work.

By the way, I could configured successfully p4Merge in mergespecfile.txt, but I prefer vsDiffMerge.exe :)

alt text

alt text

yaml-merge.png (25.6 kB)
vs-merge.png (26.0 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by andrasgabor · Oct 15, 2018 at 05:58 PM

I created a proxy script as:

 o:\git\tools\vsmerge.bat


Content:

 "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsDiffMerge.exe" /m "%1" "%2" "%3" "%4" 


I am invoking this from mergefilespec.txt:

  * use "o:\git\tools\vsmerge.bat" "%r" "%l" "%b" "%d"


It did not work without the proxy script. This way though the merge button works in the team explorer from VS for code.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image EyePD · Aug 21, 2019 at 07:32 PM 0
Share

Nice workaround. Here's my attempt at TortoiseGit$$anonymous$$erge:

 * use "c:\util\yamlmerge-tortoisemerge.bat" "%b" "%l" "%r" "%d"
 
 "C:\Program Files\TortoiseGit\bin\TortoiseGit$$anonymous$$erge.exe" /base:%1 /$$anonymous$$e:%2 /theirs:%3 /merged:%4



avatar image
0

Answer by guiquadros · Mar 29, 2017 at 06:23 PM

I found a solution that worked for me (although I could not correctly configure the mergespecfile.txt file to use vsDiffMerge.exe):

in .gitconfig I added an addition entry:

 [mergetool "vs"]
     cmd = 'C:/Program Files (x86)/Microsoft Visual Studio 12.0/Common7/IDE/vsdiffmerge.exe' $LOCAL $REMOTE $BASE $MERGED //m
     trustExitCode = true

And in the console I run:

For .prefab and .unity:

 git mergetool

For .cs:

 git mergetool --tool=vs

If I need to run for a specific file:

 git mergetool --tool=vs *<file_name>.cs

Here is my whole merge/diff configuration in the .gitconfig file:

 [mergetool "vs"]
     cmd = 'C:/Program Files (x86)/Microsoft Visual Studio 12.0/Common7/IDE/vsdiffmerge.exe' $LOCAL $REMOTE $BASE $MERGED //m
     trustExitCode = true
 
 [difftool "sourcetree"]
     cmd = 'C:/Program Files (x86)/Microsoft Visual Studio 12.0/Common7/IDE/vsdiffmerge.exe' $LOCAL $REMOTE Source Target //t
 [mergetool "sourcetree"]
     cmd = 'C:/Program Files/Unity5.5.1f1/Editor/Data/Tools/UnityYAMLMerge.exe' merge -p $BASE $REMOTE $LOCAL $MERGED
     trustExitCode = false
     keepTemporaries = true
     keepBackup = false
 
 [merge]
     tool = sourcetree
 [diff]
     tool = sourcetree
     
 [core]
     autocrlf = true

So, this solved my merge issues with the .cs files (which was my main merge configuration problem). But my fallback tool in the mergespecfile.txt is still p4merge (which does not bother me so much to solve unsolved scene and prefab conflicts the Unity Smart merge could not handle):

 unity use "C:\Program Files\Perforce\p4merge.exe" "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
 prefab use "C:\Program Files\Perforce\p4merge.exe" "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
 
 # Perforce merge
 * use "%programs%\Perforce\p4merge.exe" "%b" "%l" "%r" "%d"
 * use "%programs%/p4merge.app/Contents/Resources/launchp4merge" "%b" "%l" "%r" "%d"

If anyone knows how to configure the mergespecfile.txt to work with the vsDiffMerge.exe as the fallback tool I would like to see the solution.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image TuRtoise · Jun 10, 2018 at 12:28 PM 0
Share

Hey, I know this post is more than a year old, but I'll take my chances. I'm currently experiencing the very same issue - cannot configure vsDiff$$anonymous$$erge to act as a fallback tool properly. Did you get it solved by any chance?

avatar image guiquadros · Jun 10, 2018 at 07:27 PM 0
Share

Hello @TuRtoise, the answer is no. I still running “git mergetool --tool=vs myFile.cs” for code merges (.cs files) and “git mergetool myFile.prefab” for prefabs and scenes. When the Smart $$anonymous$$erge fails to merge a prefab or scene another fallback tool (not VS) is called to solve the conflict (I was using p4merge, but now I am trying Win$$anonymous$$erge). So I am still unable to use Visual Studio as a fallback tool for the Smart $$anonymous$$erge.

avatar image EyePD guiquadros · Aug 21, 2019 at 06:08 PM 0
Share

The nice thing with Win$$anonymous$$erge is that it's command line will accept dashes ins$$anonymous$$d of forward slashes which gets around the YA$$anonymous$$L$$anonymous$$erge issue. Unfortunately I've not yet figured out the right set of command line options.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

98 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Visual Studio / Git / Unity - All files and folders I add are going into untracked files - why? 1 Answer

Visual Studio 2022 fails to open solution to selected script from Unity and keeps opening new windows 0 Answers

Mesh Collider - merge meshes or not? 0 Answers

Dubugging in Visual Studio 2015, Unity 5.2 0 Answers

Is the visual studio account free ? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges