2016-06-09 63 views
4

我想在Microsoft Team Foundation Server Git存储库中使用git命令行工具。为什么使用GIT的TFS不能从命令行工作?

但是每次我想访问远程回购时,验证都会失败。当然,我正在使用Active Directory(这是一个TFS服务器)。 git repo管理在Visual Studio中完美工作。 (甚至推,同步,克隆等)。

Cloning into 'blabla' 
fatal: Authentication failed for 'http://server:8080/tfs/BlaCollection/_git/blabla/' 

我已经使用这个patters intented,总是失败。

  • 域\用户名
  • 用户名@ domainforest

有人已经开始使用命令行工具到TFS Git的服务器相连? 在我公司我们用令牌登录Windows,可能是原因?

+0

叫什么版本你用的Git?你可以安装最新的Git,然后再试一次吗? –

+0

我用最新的测试:2.9.0-windows1。但是同样的事情。 –

+0

安装GCM,然后再试一次:https://github.com/Microsoft/Git-Credential-Manager-for-Windows –

回答

3

最后一个collegue击中解决方案,我将它张贴在这里:

命令:

git config --global credential.http://[tfs_server].integrated true 

当然,更换[tfs_server]用自己的TFS服务器的主机名。

当凭证管理器要求凭证留空时,然后按确定。 (我这样认证将使用Kerberos执行)。

点击这里了解更多信息https://github.com/Microsoft/Git-Credential-Manager-for-Windows#q-i-thought-microsoft-was-maintaining-this-why-does-the-gcm-not-work-as-expected-with-tfs

-1

尝试使用验证用命令直接如--username--password参数:

git tfs clone http://tfs:8080/tfs/DefaultCollection $/Project1 -u=Domain\username -p=xxx 

-u,--username = VALUE表示TFS用户名
-p,--password = VALUE代表TFS密码

无论您的公司如何使用Windows登录,您只需要在TFS中登录的帐户。您可以在Windows-Control Panel- Credential Manager


Visual Studio中存储凭证的帐户信息在Windows凭据管理器,这与Git Credential Winstore兼容。 如果您安装Git Credential Winstore,它应该永久使用Git存储库进行身份验证,您也可以尝试使用此工具。

+0

不。我没有使用Visual Studio Online。而博客文章有错误的标题 –

+0

而我已经在使用Git Credential Store –

+0

对不起,我的错误,请看我的更新。你是否直接在Git命令中使用-u -p?无论您的公司如何使用Windows登录,只需要在TFS中登录的帐户。你可以在'Windows-Control Panel- Credential Manager'中找到帐户信息 –

0

的Windows Creidentials - >通用Creidentials

然后添加一个新的项目:在HTTP前面的 “混帐”://即:

的git: http://Example.com

添加域\用户作为用户, 和密码

相关问题