本文介绍了在Visual Studio中切换Git和TFS源代码控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我处于需要同时运行TFS和Git的情况。我需要在两者之间切换。 Git已安装并配置为在本地运行。 TFS在公司服务器上运行。如何在Visual Studio 2013中的两种环境之间切换?
如果git集成得到改进,我很乐意切换到VS 2015。
VS首先检测到Git,然后切换到团队资源管理器中的源代码管理。我偶然发现了一种切换到TFS的方式(我不记得),现在我不知道如何切换回Git。
如果你我需要与TFS并排运行Git,因为我不允许在TFS中创建分支,并且我不会在主干中提交任务或管理N个搁置集。我将使用功能分支 解决方案
如果您想使用TFS工作区并使用GIT,你可以使用Team Explorer在它们之间切换。点击屏幕顶部的插件查看项目,您可以在它们之间切换。屏幕截图来自VS 2015,但UI从2013年没有太大改变
如果您想在您的本地机器上专门使用git,但在服务器上推送至TFS,请查看
你可以将你的Trunk从TFS复制到本地git仓库,专门用于git并使用特性分支等。当你的代码准备好发送回Trunk时,你可以重定位并推送它,例如:
git -tf克隆http:// myserver:8080 / tfs / mycollection $ / TeamProjectA / Trunk
在Git repo中修改文件
git commit -a -m提交一个
(在本地提交更改)
制作更多更改
git commit -a -m提交两个
git-tf pull --rebase
git-tf checkin
I'm in a situation where I need to run both TFS and Git side by side. I will need to switch between the two. Git is installed and configure to run locally. TFS is run on a company server. How do I switch between the two environments in Visual Studio 2013?
I am open to switching to VS 2015 if git integration has improved.
VS first detected Git and then switched over to that source control in "Team Explorer". I stumbled onto a way to switch to TFS (that I do not recall) and now I don't know how to switch back to Git.
If you care, I need to run Git side by side with TFS because I'm not allowed to create branches in TFS and there's no way I'm going to play around with commits in the Main trunk or manage N number of shelvesets. I'm going to use feature branches
解决方案
If you want to use a TFS workspace and also use GIT then you can switch between them using Team Explorer. Hit the "plug" looking item at the top of the screen and you can switch between them there. The screen shot is from VS 2015 but the UI hasn't changed much from 2013
If you want to use git exclusively on your local machine and but push to TFS on the server then take a look at "git-TF"
You can clone your "Trunk" from TFS to a local git repo, work exclusively in git and use feature branches etc. When your code is ready to send back to Trunk then you can rebase and push i.e.
git-tf clone http://myserver:8080/tfs/mycollection $/TeamProjectA/Trunk
Make changes to the file in the Git repo
git commit -a -m "commit one"
(commit changes locally)
Make more changes
git commit -a -m "commit two"
git-tf pull --rebase
git-tf checkin
这篇关于在Visual Studio中切换Git和TFS源代码控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!