为什么带有 GIT 的 TFS 不能从命令行工作? [英] Why TFS with GIT is not working from command line?

查看:26
本文介绍了为什么带有 GIT 的 TFS 不能从命令行工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 Microsoft Team Foundation Server Git 存储库中使用 git 命令行工具.

I want to use the git command line tools with the Microsoft Team Foundation Server Git repositories.

但是每次我想访问远程存储库时,身份验证都会失败.当然,我使用的是 Active Directory(这是一个 TFS 服务器).git repo 管理在 Visual Studio 中完美运行.(甚至推送、同步、克隆等).

But every time I want to access to remote repos the authentication fails. And of course I am using Active Directory (this is a TFS server). The git repo management works perfectly from Visual Studio. (even push, sync, clone, etc).

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

我打算使用这种模式,但总是失败.

I have intented using this patters and always fail.

  • 域用户名
  • 用户名@domainforest

有人使用命令行工具通过 git 服务器连接到 TFS 吗?我公司用token登录windows,可能是这个原因?

Anyone has get connected using command line tools to a TFS with git server? In my company we use tokens to log on Windows, may be the reason?

推荐答案

终于有同事找到了解决方案,我会在这里发布:

Finally a collegue hit the solution and I will post it here:

使用命令:

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

当然,将 [tfs_server] 替换为您自己的 TFS 服务器主机名.

Of course, replace [tfs_server] with your own TFS server host name.

当凭据管理器要求提供凭据时,只需留空并按 OK.(我这样身份验证将使用 Kerberos 执行).

When Credential Manager asks for credentials just leave blanks and press OK. (I this way authentication will be performed using Kerberos).

在此处查看更多信息 https://github.com/Microsoft/Git-Credential-Manager-for-Windows#qi-thought-microsoft-was-maintaining-this-why-does-the-gcm-not-work-as-expected-with-tfs

这篇关于为什么带有 GIT 的 TFS 不能从命令行工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆