简体   繁体   English

TFVC检查最佳实践

[英]TFVC checkin best practice

Many people told me that the best practice of checking in my code on TFVC is getting latest before. 许多人告诉我,在TFVCchecking in我的代码的最佳做法是之前的getting latest

I don't know why I think that TFS smart enough and there is no difference between getlatest then checkin or getlatest after checkin 我不知道为什么我觉得TFS足够聪明,有什么区别getlatest然后checkingetlatestcheckin

In my opinion when working with TFVC in TFS, the process should be: 在我看来,在TFS中使用TFVC时,过程应该是:

  1. You get latest 你得到最新的
  2. You write your tests 你写了你的考试
  3. You make them pass 你让他们通过
  4. You get latest including conflicts and resolve all conflicts 你得到最新的包括冲突和解决所有冲突
  5. You run your tests 你运行测试
  6. If they fail you fix and go back to 4 如果他们失败了你修复并回到4
  7. When they pass and after doing a get latest you checkin 当他们通过并且在做了最新的事情之后你会检查

(this process is the same for all server-based source control systems) (对于所有基于服务器的源控制系统,此过程相同)

If you do not do this then you are not writing your code on the latest codebase so while tfvc can merge, if something has happened like a method being changed or removed, the merge won't help. 如果你不这样做,那么你不是在最新的代码库上编写你的代码,所以当tfvc可以合并时,如果发生某些事情就像一个方法被更改或删除,合并将无济于事。

Be a good citizen and get latest before you checkin - ideally you should have a CI build which checks this and if you do you will often break the build which is bad for everyone. 做一个好公民并在签到之前获得最新信息 - 理想情况下你应该有一个CI版本来检查这个,如果你这样做,你将经常打破对每个人都不利的构建。

Edited: I have added that when you checkout you also get all conflicts, otherwise if you have done something like added a file the project won't be downloaded when you do a get latest, this is pretty important actually with TFS. 编辑:我已经补充说,当你结账时你也会得到所有冲突,否则如果你做了类似添加文件的事情,当你做最新的时候项目将不会下载,这对TFS来说非常重要。

I would share some of my opinions when working with TFS: 在与TFS合作时,我会分享一些我的意见:

It's smart, it helps to perform auto-merge many times (if my code is not conflict with others). 这很聪明,它有助于多次执行自动合并(如果我的代码与其他代码不冲突)。 Otherwise, you can see all conflicted files and do merge yourself file by file or you can decide to take server version / local version. 否则,您可以查看所有冲突的文件并按文件合并自己,或者您可以决定采用服务器版本/本地版本。

If not doing get latest, you may need to perform a second shoot, example: - You add some files to a project Business.csproj - Your colleage also added some files to that project. 如果没有做到最新,您可能需要执行第二次拍摄,例如: - 您将一些文件添加到项目Business.csproj - 您的同事还向该项目添加了一些文件。 TFS merges the file and requires Visual Stiduo to reload the project. TFS合并文件并要求Visual Stiduo重新加载项目。

Let's imaging we often review all changes, run tests... before checking in. There are 40 files, on both cases confliction or reload project, a second check needs to be done... 让我们成像我们经常检查所有更改,运行测试...在签入之前。有40个文件,在两个案例冲突或重新加载项目,需要进行第二次检查...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM