Is it possible to disable the auto-merge option in Visual Studio Team System 2008? If so how?

柔情痞子 提交于 2019-11-29 23:27:41
Andrey

Try do the following (working in all Visual Studio versions from 2012-onwards):

Tools -> Options -> Source Control -> Visual Studio Team Foundation Server -> Uncheck "Attempt to automatically resolve conflicts when they are generated":

The short answer as of Visual Studio 2008 seems to be no.

Whenever two people have changed the same file, you have to "merge" the code. This can take three forms:

  • Keep your version (discarding their changes)
  • Keep their version (discarding your changes)
  • Merge both changes to blend them both together

You can't "turn this off", because there is no other safe way to resolve the clash.

The closest you can get to turning merging off is to disallow multiple checkouts (lock the file so that only one developer can work on it at a time). This prevents two concurrent edits occurring, and thus avoids the problem of merging entirely. (At the extra cost of developers often being blocked and unable to work on a file while another developer has the lock). This is an awful and usually inefficient way to work - I wouldn't recommend it.

You can minimise the need for merges:

  • Check in frequently. Many small changes reduces your exposure to merge conflicts, while a few large changes increase your exposure.
  • Split large and often-changed files up into many smaller files to minimise the chance that 2 developers need to chnage the same file at the same time
  • Before you start working on a file, check if anyone else is editing it, and try to reorganise your "schedule" so that you don't have to start editing that file while the other programmer is working on it (a self-imposed "soft lock", to just reduce the chance of merges being necessary)

You can also upgrade the merge tools. Visual Studio's merge is horrible, difficult to use, and often introduces problems into the code. It has bitten me so many times I cannot ever trust it, so have to do painful manual merges every time. I now use Araxis Merge which always does an automatic merge perfectly, giving me confidence that I can just leave it to do the merge for me. (I've never used another merge program that gives me that confidence, and I've tried pretty much every other option over the years). When a manual merge is required, it offers a very clear merge view to "read", and very quick and intuitive UI for choosing how to merge each bit of code, making it very efficient. I once struggled for 3 days with a complex merge in VS (corrupting the code several times until I gave up) then I bought Araxis Merge and re-did the entire merge perfectly in 15 minutes. A good tool really takes the pain out of merging.

(I am not affiliated with Araxis in any way, I just can't stand most of the terrible merge tools out there)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!