无法在远程虚拟机上进行git克隆

时间:2015-07-10 16:20:17

标签: git

我正在尝试将存储库克隆到我的远程虚拟机上,但它不起作用。 我收到以下错误

[PepperBoy@remserver check]$ git clone -b integratedscript https://github.com/PepperBoy/Project101.git
Initialized empty Git repository in /home/PepperBoy/myscript/Project101/.git/
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/PepperBoy/Project101.git/info/refs

fatal: HTTP request failed

在我的个人笔记本电脑上,当我尝试上述操作时,它的工作正常。

我试过从远程虚拟机ping并且工作正常

PING github.com (192.30.252.128) 56(84) bytes of data.
64 bytes from github.com (192.30.252.128): icmp_seq=1 ttl=54 time=85.8 ms
64 bytes from github.com (192.30.252.128): icmp_seq=2 ttl=54 time=86.3 ms
^Z

我还生成了一个ssh密钥并将其添加到我的github

[PepprBoy@remserver check]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/PepprBoy/.ssh/id_rsa): y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in y.
Your public key has been saved in y.pub.
The key fingerprint is:
08:f5:25:34:ea:42:c3:fb:7a:67:95:17:a7:83:8a:9e PepprBoy@remserver
The key's randomart image is:
+--[ RSA 2048]----+
|      ..+ .      |
|   . . o +       |
|    = . .        |
|   . = .    . .  |
|    o o S  o +   |
|     o    + +    |
|      .. o . .   |
|     .o.+        |
|    .oEo         |
+-----------------+
[PepprBoy@remserver check]$ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA74n/3lzA2kfu3gnPtwXV4tVbL715Jb6wkTa1IY/OT/p+RXxrg9CVtZThVsz3140bNNk2AsBXAkOAHQq31vBoChO8LNefWQyzK85XWEyJvPHJkwhpgPbZdCZ1xAF/1ItprQxPlhVolZ7zKX1QRKGGkqR5a9uzBpwC9gTC/1bpkcbZYNU3ZRUShqIVvMas58i67M03Z8Z7UrGE0PNCLcw0nMFzediGTXaXHVlKyWBSDvmX96cxO1CvBdIZuzBSVEff6vNZ0orbUQ/9mLCJkrkTBMbSaba6NAA8JZhWrQE3GGdZ7SAHPO+shmH2SPNvv4C+19A+ZWE0h+oawSEYt9e0RQ== PepprBoy@remserver
[PepprBoy@remserver check]$

请告诉我如何将这个回购克隆到我的虚拟机。 (这实际上是私人回购)

1 个答案:

答案 0 :(得分:0)

您可能正在使用运行环境中的credential-helper,它将为您缓存密码。这对您的VM无法使用。你在哪里输入密码?

或者,您可能已将密码放在周围计算机的.netrc文件中,但未在VM中使用。