简体   繁体   English

Git和TFS版本控制团队合作

[英]Git and TFS version control Team Work

we are a medium company with about 15 C# developers 我们是一家中等规模的公司,大约有15位C#开发人员

We would like to dismiss sourcesafe (five years talking about it!!!) and go to use Git and TFS 我们想取消Sourcesafe(谈论它的五年!!),然后使用Git和TFS。

Git because is probably the past, the present and future in version control and TFS because we would like to have all centralized and VS integration/functionalities Git因为可能是版本控制和TFS的过去,现在和未来,因为我们希望拥有所有集中式和VS集成/功能

In particular we want to avoid two or more people working on the same file at the same time 特别是,我们要避免两个或更多的人同时处理同一文件

We have 3 big products 我们有3大产品

  • erp erp
  • cash point software 现金点软件
  • web products catalogue (all other web project) Web产品目录(所有其他Web项目)

So there are 3 teams working on the 3 projects/areas 因此,有3个团队致力于这3个项目/区域

We have common classes used by all teams and specific classes used by each team 我们有所有团队使用的通用类,每个团队使用的特定类

For Example 例如

Proj1 uses: Proj1使用:

  • Solution Project (windows form) 解决方案项目(Windows窗体)
  • Class1 Common 1类通用
  • Class2 Common 普通2类
  • Class1 Erp 1类Erp
  • Class2 Erp 2类Erp

Proj2 uses: Proj2使用:

  • Solution Project (windows form) 解决方案项目(Windows窗体)
  • Class1 Common 1类通用
  • Class3 Common 3类通用
  • Class4 Common 普通4类
  • Class1 Cash Point 1类现金点
  • Class2 Cash Point 2类现金点

Proj3 uses: Proj3使用:

  • Web Project 网路专案
  • Class1 Common 1类通用
  • Class2 Common 普通2类
  • Class3 Common 3类通用
  • Class1 Web Class1网站
  • Class2 Web Class2 Web

We would like to create a repository for each class and then use them in main project solution but i've read it's not possibile with Visual Studio and TFS (git subdirectories). 我们想为每个类创建一个存储库,然后在主项目解决方案中使用它们,但是我已经读到它不能与Visual Studio和TFS(git子目录)一起使用。

Is it right? 这样对吗?

how can we have this result in another way? 我们怎么能以另一种方式得到这个结果呢?

What we would like to avoid is to create a unique repository and force developers to download all classes and solutions 我们要避免的是创建一个唯一的存储库,并迫使开发人员下载所有类和解决方案

Your solution setup sounds very Source Safe'ish (which makes sense, since that's what you're using), but the old strategy won't carry forward into Git nor TFVC easily. 您的解决方案设置听起来非常“源安全”(这很有意义,因为这就是您所使用的),但是旧的策略不会轻易推广到Git或TFVC中。 The VSS Pin feature is missing from both systems, so you can't use the same file in multiple folders 1) . 两个系统都缺少VSS引脚功能,因此不能在多个文件夹1)中使用同一文件。

Let's take your questions: 让我们来回答您的问题:

We would like to dismiss sourcesafe (five years talking about it!!!) and go to use Git and TFS 我们想取消Sourcesafe(谈论它的五年!!),然后使用Git和TFS。

Great! 大! That sounds like a really good idea. 这听起来是个好主意。 While you're at it, I'd really suggest you look into Visual Studio Team Services 当您使用它时,我真的建议您研究一下Visual Studio Team Services over TFS. TFS。 It sounds like your organisation isn't very good at staying current and making the step to VSTS will help you with that. 听起来您的组织不太擅长于保持最新性,而迈向VSTS一步将为您提供帮助。 Microsoft will automatically keep you current every 3 weeks. Microsoft将每3周自动为您提供最新信息。

If you need to stay on-premise, make sure people are on board with yearly major upgrades and about quarterly service pack installations. 如果您需要保持内部部署,请确保每年进行重大升级并大约每季度安装一次Service Pack。

In particular, we want to avoid two or more people working on the same file at the same time 特别是,我们要避免两个或两个以上的人同时处理同一文件

As to locking files, that's a thing of the past. 至于锁定文件,这已经成为过去。 Given the distributed nature of Git, it's not meant to lock anything. 鉴于Git的分布式特性,它并不意味着要锁定任何东西。 It uses very advanced merging techniques to try and make it as easy as possible to merge your changes, no matter what mess you're making. 它使用非常先进的合并技术来尝试并使其尽可能容易地合并您的更改,而不管您造成什么混乱。 Git was originally developed to support the Linux Kernel sources and manage asynchronous changes from people all around the world. Git最初是为了支持Linux内核源并管理来自世界各地的人们的异步更改而开发的。 Central locking would be a nightmare in that scenario. 在这种情况下,中央锁定将是一场噩梦。

In TFVC the concept of locking still exists, but only if you're using the 2010 style Server Workspaces. 在TFVC中,锁定的概念仍然存在,但前提是您使用的是2010样式的服务器工作区。 The Local workspaces introduced in 2012 (and default for most projects) have done away with locking files as well. 2012年引入的“本地”工作空间(大多数项目的默认设置)也取消了锁定文件。 TFVC does have more features to help you in this respect (over Git), the Incoming Changes code lens, for example, will warn you when others have checked in code right above every method to prevent you from accidentally editing them without syncing sources first. TFVC确实在这方面(通过Git)具有更多帮助您的功能,例如,“传入更改”代码镜头会在其他人检入每种方法正上方的代码时向您发出警告,以防止您在不先同步源的情况下意外编辑它们。 Locking files only works when: all developers are using server workspaces and when exclusive checkout has been explicitly turned on (default is off since 2005). 锁定文件仅在以下情况下起作用: 所有开发人员都在使用服务器工作区,并且显式打开了独占签出(自2005年以来默认为关闭)。

So while TFVC supports exclusive checkout, all the defaults try to turn you away from this workflow. 因此,尽管TFVC支持独占签出,但所有默认设置都试图使您远离此工作流程。 This should be saying something. 这应该是说些什么。

We would like to create a repository for each class and then use them in main project solution but I've read it's not possible with Visual Studio and TFS (git subdirectories). 我们想为每个类创建一个存储库,然后在主项目解决方案中使用它们,但是我已经读过它对于Visual Studio和TFS(git子目录)是不可能的。

It's probably best to extract your shared classes to a separate project and to then either put that separate project in a Git Submodule, or to package that separate project into a NuGet package and reference these shared classes in your other projects that way. 最好将共享类提取到一个单独的项目中,然后将该单独的项目放入Git子模块中, 或者将该单独的项目打包到一个NuGet包中,然后以这种方式在其他项目中引用这些共享类。

Visual Studio 2017 has "support" for submodules. Visual Studio 2017具有对子模块的“支持”。 It can load them and shows them in the changes window, but the UI is not very intuitive and needs a bit of work to make it easy to use. 它可以加载它们并在“更改”窗口中显示它们,但是UI并不是很直观,需要做一些工作才能使其易于使用。 You're psobably going to have to rely on using the git commandline a lot when taking the submodules route. 采取子模块路线时,您很可能不得不非常依赖使用git命令行。 The VSTS/TFS Build agents (not the XAML agents) also support submodules. VSTS / TFS Build代理(不是XAML代理)也支持子模块。

TFS 2018 and Visual Studio Team Services offer a built-in NuGet repository feature (package management) which you can leverage to then share and manage these shared classes. TFS 2018和Visual Studio Team Services提供了内置的NuGet存储库功能(程序包管理),您可以利用它来共享和管理这些共享的类。 I'd personally recommend that route. 我个人会推荐那条路线。 Create a separarte repository for shared code and configure a CI build to automatically create a NuGet package with the latest changes. 创建用于共享代码的separarte存储库,并配置CI构建以自动创建具有最新更改的NuGet软件包。 You can then reference this NuGet package from the dependent projects. 然后,您可以从相关项目中引用此NuGet包。

Regardless of your target solution, you're likely going to have to refactor your solution structure a bit. 无论您的目标解决方案是什么,您都可能不得不重构您的解决方案结构。 Submodules can only be loaded into subdirectories. 子模块只能加载到子目录中。

What we would like to avoid is to create a unique repository and force developers to download all classes and solutions 我们要避免的是创建一个唯一的存储库,并迫使开发人员下载所有类和解决方案

I wonder why, but if you want to break out into separate repositories, then either submodules or separate Git repositories + NuGet packages will solve this for you. 我想知道为什么,但是如果您想分成单独的存储库,那么无论是子模块还是单独的Git存储库+ NuGet软件包都可以为您解决这个问题。 The NuGet solution will work with TFVC as well. NuGet解决方案也将与TFVC一起使用。

Also remember that with Git you always create a full local copy, including all history of your linked repositories. 还请记住,使用Git,您始终会创建完整的本地副本,包括链接存储库的所有历史记录。

thanks for your answer 感谢您的回答

About migration to Git and TFS as you now people hardly change from what they know to unknown. 关于现在迁移到Git和TFS的问题,人们几乎不会从他们所知道的变为未知。 i'm working on it.... 我在做这个工作....

Another problem is we have to stop working for some days (how many? who know?) during migration with danger to lose data or parts of code 另一个问题是,在迁移期间,我们必须停止工作几天(几步?谁知道?),否则有丢失数据或部分代码的危险。

But i'm confidet we will do it 但我有信心我们会做到的

About locking files i think it's difficult to know if it is a good or a bad thing. 关于锁定文件,我认为很难知道它是好是坏。 i believe it's depend on situation 我相信这取决于情况

In our scenario (small/medium company), where developer works on a specific project without interaction with other, it's valid 在我们的方案(中小型公司)中,开发人员在不与其他人交互的情况下从事特定项目,这是有效的

In a scenario of changes from people all around the world, as you wrote, it's not valid 正如您所写,在世界各地的人们不断变化的情况下,这是无效的

I also tried visual studio's merge and i found it very uneasy and we change 1 code line just for a try! 我还尝试了Visual Studio的合并,但发现它很不舒服,我们仅尝试更改1条代码行! I don't know how it can be if you have to merge more parts of code. 我不知道如果必须合并更多的代码部分会怎样。 Much better is Git's merge 更好的是Git的合并

How many times developer will lost on merging files or fix code? 开发人员在合并文件或修复代码时将损失多少次?

About VS which support more than one repository i readed it's not possible just one month ago 关于VS,它支持一个以上的存储库,我读过一个月前不可能

Can you send me something about it please? 你能给我寄一些东西吗? You wrote we will have to use submodules and a lot of Git commandline. 您写道我们将不得不使用子模块和大量的Git命令行。 Don't you think it's very uncomfortable compared to a sourcesafe's management? 与Sourcesafe的管理人员相比,您不觉得这很不舒服吗? Or it would suffice that VS let's open repositories like references 还是让VS让我们打开诸如引用之类的存储库就足够了

We also thought about nuget packages We was ready to start with these solution but some developers complain they will not be able to change code runtime during debug (it's so diffucult to make agree many people....) 我们还考虑了nuget包,我们已经准备好从这些解决方案开始,但是一些开发人员抱怨说,它们在调试期间将无法更改代码运行时(很难达成共识。...)

Another problem is you have to deploy every time your nuget packages and their dependeces. 另一个问题是每当您的nuget软件包及其依赖项都必须部署。 it's more complex than have references as projects 它比将引用作为项目更复杂

I will treasure about your answers trying to change our mentality 我会珍惜您试图改变我们心态的答案

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

相关问题 Team Foundation Server版本控制警报 - team foundation server version control alert 如何以编程方式浏览TFS版本控制中的项目 - How to browse items in TFS Version Control programmatically 在TFS中取消“获取最新版本”是否有效? - Does canceling “get latest version” work in TFS? C#Team Foundation Point版本控制服务器到映射项目 - c# team foundation point version control server to mapped project TFS API - 如何从特定的团队项目中获取工作项 - TFS API - How to fetch work item(s) from specific Team Project 链接到TFS-Git的Visual Studio 2013中的C#DLL项目的团队资源管理器中未出现构建节点 - Build Node doesn't appear in Team Explorer for a C# DLL project in Visual Studio 2013 linked to TFS-Git 如何在团队项目中为C#类中的组设置版本控制权限? - How Set version control permission in a Team Project for a group in a C# class? 是否有可能使用团队资源管理器进行版本控制而无需为Visual Studio购买许可证? - is it possible to use team explorer for version control without buying license for visual studio? Team Foundations版本控制-VersionControlServer-从路径中获取文件夹和文件的列表? - Team Foundations Version Control - VersionControlServer - Get a list of folders and files from path? Visual Studio for Mac 2022 - GIT 和版本控制在哪里? - Visual Studio for Mac 2022 - Where is GIT and Version Control?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM