我在 ubuntu 22.04 上使用诗歌 1.4.0,并尝试将特定的 git 分支添加到我的项目中:
poetry add git+ssh://git@dev/home/git/projects/jaydebeapi#nanosecond_fix
Failed to clone ssh://git@dev/home/git/projects/jaydebeapi at 'nanosecond_fix', verify ref exists on remote.
这很奇怪,因为手动 git 克隆可以工作:
git clone -b nanosecond_fix ssh://git@dev/home/git/projects/jaydebeapi
Cloning into 'jaydebeapi'...
remote: Counting objects: 1592, done.
remote: Compressing objects: 100% (572/572), done.
remote: Total 1592 (delta 879), reused 1592 (delta 879)
Receiving objects: 100% (1592/1592), 397.30 KiB | 4.14 MiB/s, done.
Resolving deltas: 100% (879/879), done.
有什么想法吗?
注意:服务器和客户端上的 GIT 版本均为 2.34.1
最佳答案
以防万一,如issue 835 ,验证远程分支是否存在。
默认情况下,您所做的手动克隆将 checkout main
分支,而不是“nanosecond_fix
”分支。
不过,在手动克隆中,您可以列出所有本地和远程分支:
git branch -avv
如果分支存在,您可以switch branch in a bare repository :
git symbolic-ref HEAD refs/heads/nanosecond_fix
关于Python 诗歌无法克隆验证远程上是否存在引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75775587/