我在 Gitea 上有一个私人 git 存储库。我已经为我的服务器设置了部署密钥,并且在服务器上我有相关的私钥C:\Users\harry\.ssh\id_ed25519
当我尝试直接git clone
回购时,它可以正常工作:
(venv) harry@DESKTOP-4NS8B70 d:\>git clone "ssh://git@git.myserver.com/my_username/my_package.git" my_package
Cloning into 'my_package'...
Enter passphrase for key '/c/Users/harry/.ssh/id_ed25519':
remote: Enumerating objects: 52, done.
remote: Counting objects: 100% (52/52), done.
Receiving objects: 100% (52/52), 10.18 KiB | 5.09 MiB/s, done.
Resolving deltas: 95% (20/21)00% (45/45), done.
remote: Total 52 (delta 21), reused 0 (delta 0)
Resolving deltas: 100% (21/21), done.
到目前为止,一切都很好!但是,当我尝试通过它安装相同的软件包时pip install -e "git+ssh://git@git.myserver.com/my_username/my_package.git#egg=my_package"
会导致错误:
(venv) harry@DESKTOP-4NS8B70 d:\>pip install -e "git+ssh://git@git.myserver.com/my_username/my_package.git#egg=my_package"
Obtaining my_package from git+ssh://****@git.myserver.com/my_username/my_package.git#egg=my_package
Cloning ssh://****@git.myserver.com/my_username/my_package.git to d:\my_app\venv\src\my-package
Running command git clone -q 'ssh://****@git.myserver.com/my_username/my_package.git' 'd:\my_app\venv\src\my-package'
git@git.myserver.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
WARNING: Discarding git+ssh://****@git.myserver.com/my_username/my_package.git#egg=my_package. Command errored out with exit status 128: git clone -q 'ssh://****@git.myserver.com/my_username/my_package.git' 'd:\my_app\venv\src\my-package' Check the logs for full command output.
当然,当我尝试pip install -r requirements.txt
使用以下条目时也会发生同样的事情
-e "git+ssh://git@git.myserver.com/my_username/my_package.git#egg=my_package"
我的第一个想法是问题发生了,因为它以某种方式不要求Enter passphrase for key
,但我不知道为什么!任何想法还有什么可能出错的?