git使用过程问题总结

1)没有权限。
Administrator@PC201401202312 /d/nodejs (master)
$ git push heroku master
Warning: Permanently added the RSA host key for IP address '50.19.85.132' to the list of known hosts
.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
问题的意思是说访问远程仓库的时候出错了。我猜是没有把公钥上传到heroku的原因,于是我进行了下面的操作。
$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/Administrator/.ssh/id_rsa.
Your public key has been saved in /c/Users/Administrator/.ssh/id_rsa.pub.
The key fingerprint is:
af:d2:8b:37:7f:7d:f2:65:ab:bc:d4:47:df:d6:e6:98 Administrator@PC201401202312
Administrator@PC201401202312 /d/nodejs (master)
$ heroku keys:add
Found existing public key: C:/Users/Administrator/.ssh/id_rsa.pub
Uploading SSH public key C:/Users/Administrator/.ssh/id_rsa.pub... done
Administrator@PC201401202312 /d/nodejs (master)
$ git push heroku master
Warning: Permanently added the RSA host key for IP address '50.19.85.154' to the list of known hosts
.
Initializing repository, done.
Counting objects: 2514, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2328/2328), done.
Writing objects:  10% (275/2514), 3.70 MiB | 12 KiB/s


从上面可以看到,当我在本地生成秘钥对,而且把公钥上传到heroku,之后,然后再把代码上传到heroku。这时可以上传了。



评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值