不确定这是我所提出问题的合适论坛,但是就在这里。我在使用vs代码(F1->远程容器:在容器中打开存储库)在容器中打开azure-devops存储库时遇到问题。操作失败,并显示以下消息:
我想念什么?我可以在终端上克隆仓库:
piotr@EMEA00304 Downloads % git clone https://eateam.visualstudio.com/Emailage%20Code/_git/piotr-helloworldconsole
Cloning into 'piotr-helloworldconsole'...
remote: Azure Repos
remote: We noticed you're using an older version of Git. For the best experience, upgrade to a newer version.
remote: Found 4 objects to send. (71 ms)
Unpacking objects: 100% (4/4), done.
piotr@EMEA00304 Downloads % cd piotr-helloworldconsole
piotr@EMEA00304 piotr-helloworldconsole % ls
HelloWorldConsole.csproj Program.cs
我是否需要以我的凭据配置vs代码?
很抱歉,这很明显,但是在文档中找不到任何内容:https://code.visualstudio.com/docs/remote/troubleshooting#_container-tips
我使用的vs代码的版本为1.43.2
。
更新:
我仔细检查了一下,在终端和vs代码中使用了相同的URL,这是azure-devops ui给出的:
https://eateam.visualstudio.com/Emailage%20Code/_git/piotr-helloworldconsole
这是我在vs代码中得到的输出:
[0 ms] Start: Resolving remote
[4 ms] Start: Check Docker is running
[32 ms] Start: Run: docker build -f /Users/piotr/.vscode/extensions/ms-vscode-remote.remote-containers-0.106.0/scripts/volumeBootstrap.Dockerfile -t vsc-volume-bootstrap /Users/piotr/.vscode/extensions/ms-vscode-remote.remote-containers-0.106.0/scripts
[140 ms] Sending build context to Docker daemon 7.68kB
[209 ms] Step 1/2 : FROM alpine:3.11.2
[210 ms] ---> cc0abc535e36
Step 2/2 : RUN apk add --no-cache nodejs git openssh-client docker-cli ;
---> Using cache
---> d89d8b8c3615
[210 ms] Successfully built d89d8b8c3615
[214 ms] Successfully tagged vsc-volume-bootstrap:latest
[216 ms] Cloning Github repository: _git/piotr-helloworldconsole.git into /workspaces/piotr-helloworldconsole
[217 ms] Start: Run: docker run -d --mount src=vsc-remote-containers,dst=/workspaces,type=volume,volume-driver=local -v /var/run/docker.sock:/var/run/docker.sock vsc-volume-bootstrap sleep infinity
[592 ms] Start: Run: docker exec -i -u root 1092b2cb7af09d3f9c9648f243f2279ac7ad895e215d859be57542c9f3d87f0e /bin/sh
[596 ms] Start: Launching Remote-Containers helper.
[598 ms] Start: Run in container: command -v git >/dev/null 2>&1 && git config --global credential.helper '!f() { node /tmp/vscode-remote-containers-d357f963b0fea8b37100746ad6d1376e6226b019.js $*; }; f' || true
[737 ms]
[737 ms]
[737 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-d357f963b0fea8b37100746ad6d1376e6226b019.js' >/tmp/vscode-remote-containers-d357f963b0fea8b37100746ad6d1376e6226b019.js
[741 ms]
[741 ms]
[1081 ms] Start: Run: docker exec -u root -e SSH_AUTH_SOCK=/tmp/vscode-ssh-auth-d357f963b0fea8b37100746ad6d1376e6226b019.sock -e REMOTE_CONTAINERS_IPC=/tmp/vscode-remote-containers-ipc-d357f963b0fea8b37100746ad6d1376e6226b019.sock 1092b2cb7af09d3f9c9648f243f2279ac7ad895e215d859be57542c9f3d87f0e git clone https://eateam.visualstudio.com/Emailage%20Code/_git/piotr-helloworldconsole.git /workspaces/piotr-helloworldconsole
[1207 ms] Cloning into '/workspaces/piotr-helloworldconsole'...
[2346 ms] remote: TF401019: The Git repository with name or identifier piotr-helloworldconsole.git does not exist or you do not have permissions for the operation you are attempting.
fatal: repository 'https://eateam.visualstudio.com/Emailage%20Code/_git/piotr-helloworldconsole.git/' not found
答案 0 :(得分:0)
我想念什么?我可以在终端上克隆仓库:
您为Azure Devops存储库使用了错误的Url格式。与普通的GitHub URL不同,Azure Devops Repos的正确Url格式以ReposName
而不是.git
结尾。
FtpUpload
是我的Azure Devops存储库的名称。
因此,https://eateam.visualstudio.com/Emailage%20Code/_git/piotr-helloworldconsole
在您的终端中有效,而https://eateam.visualstudio.com/Emailage%20Code/_git/piotr-helloworldconsole.git
却因错误而失败。在VS代码中使用的网址中删除多余的.git
,它应该可以工作。
要重现此问题: