0

Is there a way to disable the 'Keep my changes' button during check in?

For example:

When person A is altering class x.cs in visual studio 2010 that is under source control (TFS 2010), and person B is also altering class x.cs in VS2010.

And person B does check in his code, and after that person A wants to check-in his code, Visual Studio comes up with a message that there are conflicts:

Check In

No files checked in due to conflicting changes. Please use Conflicts Channel to resolve conflicts and try again.

Then person B can compare the code, discard his changes, but there is also a button to 'Keep Local Version'. If that button is clicked, the changes made by person A are lost.

To prevent this, I really like to know if it is possible to disable this button.

Or make a check-in policy or something to prevent this example from happening.

4

2 回答 2

2

有句老话*解决社会问题的技术解决方案很少奏效。您在这里遇到的是一个社会问题 - 人 B 正在执行一个可能不是他们想要的动作。解决方案应该是一个社交解决方案 - 鼓励您的所有员工对他们的签入负责,最重要的是在他们与共享源代码控制系统交互时进行思考。世界上所有的政策都不能代替思想。

当然,你可能会说,但最好有一个“安全捕捉”,或者一个警告机制,或者其他什么。我要说的是——已经有一个了,而且它被明确承认了!

另外,如果 B 的更改包含并包含了 A 的更改,那么他们真的扔掉 A 贡献的 delta 怎么办?


(*) 我从 2002 年找到了这个参考资料,这实际上是在文艺复兴时期的软件开发 - 我敢肯定有更旧的

于 2010-12-10T15:55:34.597 回答
0

I'm a little confused. I've never seen the "newer version" message-- at least not for .cs files. Are people checking out the files they are editing, or simply marking read-only files as writable so they can make changes?

Make sure in your source control options, that it is set to either automatically check out, or prompt you to check out when files are edited.

Overall, your best bet here is training and the use of frequent forward integration. Essentially, developers should be trained to always "get latest", resolve any conflicts, and then check in. That will eliminate this problem completely.

于 2010-12-10T13:23:34.807 回答