使用 TFS + git 设置 Xamarin Studio 版本控制
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19498404/
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
Setting up Xamarin Studio Version Control with TFS + git
提问by Chris - Haddox Technologies
I am setting up Xamarinwith Team Foundation Service + gitto develop iOS apps. I have tried many different settings trying to set up my TFS + git integration on our MAC with no avail. I keep getting exceptions of either not authorized
or failed to fetch
.
我正在使用Team Foundation Service + git设置Xamarin来开发 iOS 应用程序。我尝试了许多不同的设置,试图在我们的 MAC 上设置我的 TFS + git 集成,但无济于事。我不断收到或 的异常。not authorized
failed to fetch
回答by Chris - Haddox Technologies
I am going to list all steps I took to be as complete as possible.
我将列出我为尽可能完整而采取的所有步骤。
- First of all, I created a hosted TFS account and added a
New Team Project + Git
- I then had to create alternative login credentials since you cannot have an
@
symbol in your login info. To set up alternate creds in Visual Studio Team Services (VSTS), click on your name on the top right -> My Profile -> Credentials - After enabling the alternative credentials open Xamarin Studio. In my case I had a solution that I wanted to add so I had my solution file open as well.
- Under the
Version Control
menu item selectPublish
(Only available with solution file open) - Select the
Registered Repositiories
tab and selectAdd
- Enter an appropriate name. Select
https
protocol. - Enter your hosted TFS URL ie.
xxx.visualstudio.com
. - For port, enter
443
. - The path will be:
/DefaultCollection/_git/
+ project name (exactly as you typed it including spaces) - User will be the alternative username you created in step 2. Click
OK
on both open windows. - You will be prompted to confirm publishing. Select
OK
. - You will then be prompted for your password. Enter you alternative password you created in step 2. If you accidentally enter the wrong password here, you must delete the entry from your key chain. Instructions can be found here
- 首先,我创建了一个托管的 TFS 帐户并添加了一个
New Team Project + Git
- 然后我不得不创建替代登录凭据,因为您
@
的登录信息中不能有符号。要在 Visual Studio Team Services (VSTS) 中设置备用凭据,请单击右上角的姓名 -> 我的个人资料 -> 凭据 - 启用备用凭据后,打开 Xamarin Studio。就我而言,我有一个想要添加的解决方案,因此我也打开了我的解决方案文件。
- 在
Version Control
菜单项下选择Publish
(仅在解决方案文件打开时可用) - 选择
Registered Repositiories
选项卡并选择Add
- 输入适当的名称。选择
https
协议。 - 输入您托管的 TFS URL,即。
xxx.visualstudio.com
. - 对于端口,输入
443
. - 路径将是:
/DefaultCollection/_git/
+ 项目名称(与您输入的完全相同,包括空格) - User 将是您在第 2 步中创建的备用用户名。单击
OK
两个打开的窗口。 - 系统将提示您确认发布。选择
OK
。 - 然后系统会提示您输入密码。输入您在第 2 步中创建的备用密码。如果您不小心在此处输入了错误的密码,您必须从钥匙串中删除该条目。说明可以在这里找到
Your TFS + git integration with Xamarin Studioshould be complete! If you have any other issues I will try my best to help with them.
您的TFS + git 与 Xamarin Studio 的集成应该已完成!如果您有任何其他问题,我会尽力帮助他们。
回答by findsje
In step 12. on Windows 8 and you entered the wrong password you will have to fix it in Credential Manager.
在步骤 12. 在 Windows 8 上,您输入了错误的密码,您必须在凭据管理器中修复它。
In windows 8
在 Windows 8
In Control Panel, Open Credential Manager, On the top of the page you have two options, select "Windows Credentials". Under "Generic Credentials" look for a record for "your.visualstudio.com" click to expand and select remove. Now if you publish from Xamarin Studio you will be prompted for your password again.
在控制面板中,打开凭据管理器,在页面顶部有两个选项,选择“Windows 凭据”。在“通用凭据”下查找“your.visualstudio.com”的记录,单击展开并选择删除。现在,如果您从 Xamarin Studio 发布,系统将再次提示您输入密码。
回答by user3024922
I had problems connecting to my visualstudio.com repository even when following these instructions. What I did was to use XCode to checkout (or clone) the repository. I then opened my solution in Xamarin and it picked up the repository info just fine.
即使按照这些说明操作,我也无法连接到我的 visualstudio.com 存储库。我所做的是使用 XCode 签出(或克隆)存储库。然后我在 Xamarin 中打开了我的解决方案,它可以很好地获取存储库信息。
回答by Antarr Byrd
I use git-tf, which is a command line tool. But once you clone the repository you are able to use all the functionality like blame, revert, commit. It works with the new OSX version of Visual Studio as well.
我使用git-tf,这是一个命令行工具。但是一旦你克隆了存储库,你就可以使用所有的功能,比如blame、revert、commit。它也适用于新的 OSX 版本的 Visual Studio。
回答by Sérgio Damasceno
This is the best solution I found to connect Xamarin/Visual Studio Mac to TFS:
这是我发现的将 Xamarin/Visual Studio Mac 连接到 TFS 的最佳解决方案: