Python 诗歌无法克隆验证远程上是否存在引用

标签 python git python-poetry

我在 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/

相关文章:

python - 在Open CV中为彩色图像应用蒙版

python - 从 SVN pip 安装 [错误 2]

git - Mingw+msys2 : Failed to connect to bitbucket. org : 网络不可达

git - 可以试运行 `git revert` 吗?

docker - 如何集成 pyenv、poetry 和 docker?

python - 使用三元运算符附加到字符串时的异常行为

python - 将 IP 范围转换为 CIDR 表示法的模块、脚本或算法

git 如何在 Zend Framework 2 中包含供应商目录

continuous-integration - 如何在 GitHub Actions 中的运行之间缓存已安装的工具?

docker - COPY文件-Dockerfile旁边-不工作并阻止Docker构建