[英]How do I get my project out of Git and into TFS?
Last week I started a small project in Visual Studio 2017. Got it to the point where I want to check it into source control and share it with my co-workers. 上周,我在Visual Studio 2017中启动了一个小项目。将其保存到我想将其检入源代码管理并与同事共享的地步。 The problem is that somehow (man, I wish I knew how so that I could avoid doing this again) it got checked into Git on my machine.
问题在于(以某种方式(伙计,我希望我知道如何避免再次执行此操作))将其检入计算机上的Git。 It isn't going to do anybody any good being checked into Git on my machine.
在我的计算机上检入Git不会对任何人有任何好处。 And we've standardized on TFS.
而且我们已经在TFS上进行了标准化。 I've tried removing the .gitignore and .gitattributes files from the root folder of my VS 2017 project, but that didn't work.
我已经尝试从VS 2017项目的根文件夹中删除.gitignore和.gitattributes文件,但这没有用。 (Besides, the instant I got back into the project in VS 2017, those 2 files were recreated.)
(此外,当我回到VS 2017中的项目的那一刻,就重新创建了这两个文件。)
So, how do I get the solution and project out of Git so that I can get it into TFS/TFVC? 那么,如何从Git中获取解决方案和项目,以便将其导入TFS / TFVC?
The problem is that somehow [...] it got checked into Git on my machine.
问题在于它以某种方式被检入了我机器上的Git。
That is probably the best thing that has happened to you! 那可能是发生在你身上的最好的事情! Follow the Microsoft example and standardise on git...
遵循Microsoft示例并在git上进行标准化...
But, anyway,... Find the '.git' folder which is at the root directory (and that could be hidden), delete it and check your project in TFVC. 但是,无论如何,...找到根目录中的“ .git”文件夹(可以隐藏),将其删除并在TFVC中检查您的项目。
To get the solution out of git: 要从git中获得解决方案:
To add the solution to TFS/TFVC source control: 要将解决方案添加到TFS / TFVC源代码管理中,请执行以下操作:
TFS supports Git too, so you could push it to a git repository in TFS: TFS也支持Git,因此您可以将其推送到TFS中的git存储库:
I deleted all the .git files from the solution directory and still had issues... 我从解决方案目录中删除了所有.git文件,但仍然有问题...
Git kept defaulting to the source control even after restarting and setting source control to visual studio. 即使在重新启动源控件并将其设置为Visual Studio之后,Git仍默认使用源控件。
Fix: I then noticed that I wasn't signed into TFS! 修正:然后我注意到我没有登录TFS!
After I signed into TFS in Team Explorer GIT stopped defaulting when I tried to add the solution to source control. 当我在Team Explorer中登录TFS后,尝试将解决方案添加到源代码管理时,GIT停止了默认设置。 I was able to add to TFS.
我能够添加到TFS。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.