【发布时间】:2023-04-11 00:08:02
【问题描述】:
我和办公室的一个人有一个非常奇怪的问题,我们将存储库从 TFS 中的一个项目转移到另一个项目(我将在这里使用 TFS,但我的意思是 Visual Studio Team Services,它基本上是 TFS在云端)。
所以我们的 repo 曾经住在这样的地方:
https://somewhere.visualstudio.com/projects/_git/something
然后它被复制到另一个项目并删除了旧的,所以它现在位于:
https://somewhere.visualstudio.com/project_two/_git/something
当这里的一个人尝试从新的 repo url 克隆时:
git clone https://somewhere.visualstudio.com/project_two/_git/something
他得到了错误:
远程:TF401019:具有名称或标识符的 Git 存储库 不存在或您无权执行您的操作 正在尝试。致命的:存储库 'https://somewhere.visualstudio.com/projects/_git/something' 未找到
好像某处有一些缓存似乎将新的 repo url 重定向到不再存在的旧的 repo url。我的电脑上不会发生这种情况。
那么在 GIT 的幕后有什么东西会导致这个 repo url 被缓存在某个地方,或者 TFS 中有什么东西会导致这种行为吗?
== 详细输出 ==
somename@cf-l-003242 MINGW64 /d/Repos
$ GIT_CURL_VERBOSE=1 GIT_TRACE=1 git clone https://somewhere.visualstudio.com/project_two/_git/something
10:50:02.761600 git.c:349 trace: built-in: git 'clone' 'https://somewhere.visualstudio.com/project_two/_git/something'
Cloning into 'something'...
10:50:02.801600 run-command.c:336 trace: run_command: 'git-remote-https' 'origin' 'https://somewhere.visualstudio.com/projects/_git/something'
所以看起来源头搞砸了,但是他已经卸载并重新安装了 git,并且正在将一个 repo 克隆到一个新文件夹,所以我不知道为什么它会搞砸源头。
【问题讨论】:
-
详细输出可能有用:
GIT_CURL_VERBOSE=1 GIT_TRACE=1 git clone ...(source) -
@tom 添加了详细输出
-
检查他的全局 git 配置文件 (~/.gitconfig)。它有一个部分 [remote "origin"] 吗?
-
是的,他在某个地方有一个额外的遥控器,你能把它作为答案,我可以给你。
标签: git tfs azure-devops