使用 Visual Studio 2013 时,用于源代码控制的 TFVC(TFS 版本控制)和 Git 之间的最大区别是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20107701/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 17:21:03  来源:igfitidea点击:

What are the big differences between TFVC (TFS Version Control) and Git for source control when using Visual Studio 2013?

gitvisual-studiotfsazure-devopstfvc

提问by Greg Grater

There are tons of questions and answers about Git versus TFVC Source Control, but no current answers cover the integration of Git into Team Foundation Server/Service that I can find.

有大量关于 Git 与 TFVC 源代码控制的问题和答案,但目前没有答案涵盖我能找到的将 Git 集成到 Team Foundation Server/Service 的问题。

I'm starting green pasture development using a wide variety of languages (C#, C++, PHP, Javascript, MySSQL) using Visual Studio 2013. In the future, there will be some iOS development. I'm very familiar with SVN, VSS and TFVC for source control. However, I have never used Git. I prefer TFS for process management/agile development... It's not perfect, but it integrates well into Visual Studio.

我正在使用 Visual Studio 2013 开始使用各种语言(C#、C++、PHP、Javascript、MySSQL)进行绿色牧场开发。将来,会有一些 iOS 开发。我非常熟悉用于源代码控制的 SVN、VSS 和 TFVC。但是,我从未使用过 Git。我更喜欢使用 TFS 进行流程管理/敏捷开发......它并不完美,但它可以很好地集成到 Visual Studio 中。

So, to help me decide between these two systems...

所以,为了帮助我在这两个系统之间做出决定......

What are the big differences between TFVC and Git for source control when using Visual Studio 2013?

使用 Visual Studio 2013 时,TFVC 和 Git 之间用于源代码控制的最大区别是什么?

  • Is the only benefit in my case a local repository (not saying that it's insignificant) and iOS development support?
  • Is the only drawback to Git the command line interface (some would argue that's not a drawback ;-P).
  • Have you experienced in the Visual Studio 2013 GUI for Git? Is that enough to support basic branching/merging without the command line interface?
  • Is there a detailed start-up guide for Git that shows Git being used with Visual Studio 2013? Microsoft has a video for integrating an existing Git repository into Visual Studio 2013, but I'm looking for a start from scratch with Git and VS 2013.
  • 在我的情况下,唯一的好处是本地存储库(不是说它微不足道)和 iOS 开发支持?
  • 命令行界面是 Git 的唯一缺点(有些人认为这不是缺点;-P)。
  • 您是否体验过 Visual Studio 2013 GUI for Git?在没有命令行界面的情况下,这足以支持基本的分支/合并吗?
  • 是否有详细的 Git 启动指南显示 Git 与 Visual Studio 2013 一起使用?Microsoft 有一个将现有 Git 存储库集成到 Visual Studio 2013 的视频,但我正在寻找从头开始使用 Git 和 VS 2013 的方法。

I am not looking for a book here, but just a few bullet points and maybe some relevant links from folks that have used both TFVC and Git.

我不是在这里寻找一本书,而只是一些要点和一些使用过 TFVC 和 Git 的人的相关链接。

回答by jessehouwing

What are the big differences between TFS and Git for source control when using VS 2013?

使用 VS 2013 时,TFS 和 Git 在源代码控制方面的最大区别是什么?

MSDN has a very extensive page on all the features and differences between Team Foundation Version Control and Git.

MSDN 有一个非常详尽的页面,介绍了 Team Foundation 版本控制和 Git 之间的所有功能和差异

Is the only benefit in my case a local repository (not saying that's insignificant) and IoS development support?

在我的情况下,唯一的好处是本地存储库(不是说这是微不足道的)和 IoS 开发支持吗?

No, there's lot more, but they're often advanced scenario's of Git. Local Repo, offline support and full local fidelity on history is incredibly powerful, you get that out of the box with Visual Studio. There's a few other features that are great too! The ability to branch and merge from one repository to another is very powerful. I recommend you look up the Pro Git bookfor those. Git in TFS is just another git server, it has pretty much all features that the standard Git has.

不,还有更多,但它们通常是 Git 的高级场景。本地存储库、离线支持和完整的本地历史保真度非常强大,您可以使用 Visual Studio 开箱即用。还有一些其他功能也很棒!从一个存储库分支和合并到另一个存储库的能力非常强大。我建议您查找Pro Git 书籍。TFS 中的 Git 只是另一个 git 服务器,它具有标准 Git 的几乎所有功能。

The ability to rewrite history before merging allows you to remove or combine a number of smaller change sets, so that the history is cleaner and easier to read as a human.

在合并之前重写历史记录的能力允许您删除或合并一些较小的更改集,从而使历史记录更清晰,更容易作为人类阅读。

Is the only drawback to Git the command line interface (some would argue that's not a drawback ;-P).

命令行界面是 Git 的唯一缺点(有些人认为这不是缺点;-P)。

TFVC has a command line too, people just don't use it. For people that want to use Git and never do much more than TFVC does, they probably won't really need to leave the UI, they won't get a lot of the cool features though...

TFVC 也有命令行,只是人们不使用它。对于那些想要使用 Git 并且永远不会比 TFVC 做得更多的人来说,他们可能真的不需要离开 UI,但他们不会获得很多很酷的功能......

There might be a few other drawbacks, mostly due to the fact that it's different than what people are used to. It's not too hard to shoot yourself in the foot if you don't take the time to learn what git does when you do things. Things like Rebase and Squash are really powerful and create a very clean history, but it can leave people with the problem that they can't merge anymore if used incorrectly. TFS has the ability to put some security settings to take away the rights to make very stupid decisions on a git repository.

可能还有其他一些缺点,主要是因为它与人们习惯的不同。如果你在做事情的时候不花时间学习 git 做什么,那么你就不会太难了。像 Rebase 和 Squash 这样的东西真的很强大,可以创建一个非常干净的历史记录,但它会给人们留下一个问题,如果使用不当,它们就不能再合并了。TFS 有能力进行一些安全设置,以剥夺在 git 存储库上做出非常愚蠢的决定的权利

A very cool add-on for Git users on Windows is PoSHGit. it provides command autocompletion on the Powershell commandline.

对于 Windows 上的 Git 用户来说,一个非常酷的附加组件是PoSHGit。它在 Powershell 命令行上提供命令自动完成功能。

Have you experienced in the VS 2013 GUI for Git? Is that enough to support basic branching/merging without the command line interface?

您是否体验过 VS 2013 GUI for Git?在没有命令行界面的情况下,这足以支持基本的分支/合并吗?

It has all you need for basic operations. But you do need to be able to visualize the different branches to know what's going on. Since the Git server and local repo are just Git, any git client can help you out here. SourceTree is an option here. The Git for Windows client is another.

它具有基本操作所需的一切。但是您确实需要能够可视化不同的分支以了解发生了什么。由于 Git 服务器和本地存储库只是 Git,因此任何 git 客户端都可以帮助您。SourceTree 是这里的一个选项。用于 Windows 客户端的 Git 是另一个。

For standard operations, check-in, check-out, merge, branch (or push, pull, fetch, commit, merge) the UI works just fine.

对于标准操作、签入、签出、合并、分支(或推送、拉取、获取、提交、合并),UI 工作得很好。

Is there a detailed start-up guide for Git that shows Git being used with VS 2013? MS has a video for integrating an existing Git repo into VS 2013, but I'm looking for a start from scratch with Git and VS 2013?

是否有详细的 Git 启动指南显示 Git 与 VS 2013 一起使用?MS 有一个将现有 Git 存储库集成到 VS 2013 的视频,但我正在寻找使用 Git 和 VS 2013 从头开始​​的视频?

Starting with Git is available in a number of places... These are a few options:

许多地方都可以从 Git 开始……这些是一些选项:

Other good reads:

其他好读:

And a few tools worth installing:

还有一些值得安装的工具:

回答by James Wierzba

To clear up some confusing mixed terminology that is used a lot with TFS

澄清一些在TFS 中经常使用的令人困惑的混合术语

Team Foundation Server (TFS)is an application life cycle management tool, which includesa source version control system (VCS)component.

Team Foundation Server (TFS)是一个应用程序生命周期管理工具,其中包括一个源版本控制系统 (VCS)组件。

The VCScomponent that TFSusesis primarily Team Foundation Version Control (TFVC)

TFS使用VCS组件主要是Team Foundation Version Control (TFVC)

So, the question would be TFVCvs Git

所以,问题是TFVCGit

(In fact, TFSsupports Gitas a VCSoption.)

(事实上​​,TFS支持Git作为VCS选项。)

So, the question is: TFVC vs Git

所以,问题是:TFVC vs Git

jessehouwing has a great answer that covers this in good detail, so please reference that

jessehouwing 有一个很好的答案,详细介绍了这一点,所以请参考

As far as choosing which to use, in my opinion Gitwins

至于选择使用哪个,我认为Git获胜

  1. It is lightweight: Simple to setup and start using.
  2. It's distributed nature means it is very resilient to disasters, someone will always have a copy of the repo.
  3. Offline work is simple, you are working with your own full repository. You can commit changes, revert, browse history, etc. You only need to be online when you wish to sync with a remote repository.
  4. In TFS there is no simple way to save the state of your changes (file additions, modifications, file deletions), and switch to another state of code. (For example, to work on two features and switch back and forth). In git, you simply checkout a different branch.
  1. 它是轻量级的:易于设置和开始使用。
  2. 它的分布式特性意味着它对灾难非常有弹性,总有人会拥有一份 repo 的副本。
  3. 离线工作很简单,您正在使用自己的完整存储库。您可以提交更改、还原、浏览历史记录等。您只需要在希望与远程存储库同步时在线。
  4. 在 TFS 中,没有简单的方法来保存更改的状态(文件添加、修改、文件删除),并切换到另一种代码状态。(例如,处理两个功能并来回切换)。在 git 中,您只需签出一个不同的分支。

回答by kralyk

Is the only drawback to Git the command line interface (some would argue that's not a drawback ;-P).

命令行界面是 Git 的唯一缺点(有些人认为这不是缺点;-P)。

If you're uncomfortable with the command line interface, there are multiple GUI frontends available for Git. Git itself actually contains repository browser GUI tool called gitkand git-gui- a GUI for git. Then there are third-party apps such as git-cola, TortoiseGitand others.

如果您对命令行界面感到不舒服,Git 有多个 GUI 前端可用。Git 本身实际上包含名为gitkand git-gui- git 的 GUI 的存储库浏览器 GUI 工具。然后有第三方应用程序,如git的可乐TortoiseGit他人