gpt4 book ai didi

tfs - 如何在将 TFS 克隆到 Windows Powershell 中的 git 时传递用户名和密码

转载 作者:行者123 更新时间:2023-12-04 18:22:01 25 4
gpt4 key购买 nike

我想将 TFS 存储库导入 git 并克隆到我的本地机器,我正在使用 git-tf。在我的代码下方:- git-tf clone http://server:8080/tfs/DefaultCollection $/SampleProject D:\TFSRepoName 我想在 url 中传递用户名和密码,所以它自动克隆 repo 而不要求用户名和密码。

最佳答案

如果不想每次运行时都提示您输入凭据 git-tf ,您可以将您的凭据存储在您的存储库的 GIT 配置中:

$ git config --global git-tf.server.username your-username
$ git config --global git-tf.server.password your-password

请注意,您的密码将以纯文本形式存储在 git 配置文件中。请务必设置适当的 ACL 或文件权限,以阻止人们从您的配置文件中读取您的密码。或者您可以只存储用户名,并且每次只需要输入密码。

引用: Accessing TFS with git-tf

您也可以尝试安装和 Use the Git Credential Manager ,

When you connect to a Git repository from your Git client for the first time, the credential manager will prompt for your credentials. Once authenticated, the credential manager will create and cache a personal access token for future connections to the repo. Git commands that connect to this account will not prompt for user credentials until the token expires or is revoked through VSTS/TFS.

关于tfs - 如何在将 TFS 克隆到 Windows Powershell 中的 git 时传递用户名和密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46765227/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com