git使用过程问题总结

来源:互联网 发布:淘宝店铺认证后怎么办 编辑:程序博客网 时间:2024/03/29 08:12
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。这时可以上传了。



0 0