我在工作中使用 git 和 git-tf,但每次使用 git-tf 执行任何命令时,我都必须输入我的登录凭据。有没有办法为 git-tf 缓存我的 TFS 登录凭据,这样我就不必每次都输入它们了?
最佳答案
如果您使用 Kerberos 并且与您的 TFS 服务器所在的 Active Directory 域有信任关系,则无需输入任何密码,git-tf 将使用您的 Kerberos 票证进行身份验证。当然,这只适用于本地服务器;它不适用于 Team Foundation Service。
要缓存存储库的用户名和密码,您可以在 .git/config
中设置它们:
git config git-tf.server.username myusername
git config git-tf.server.password mypassword
但是,请注意,这会将您的密码存储为纯文本,这就是首选 Kerberos 的原因。我有兴趣添加对 git 凭据存储机制的支持,但这还不存在。
关于git-tf - 为 git-tf 缓存 TFS 登录凭据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16595040/