Github学习笔记-->Git学习中碰到的问题(更新中......)

来源:互联网 发布:群智感知网络 编辑:程序博客网 时间:2024/06/16 12:51

Github学习笔记–>Git学习中碰到的问题(更新中……)

1.在命令窗口中输入git clone git@github.com:the3musketeers/ife.git后出现

“Please make sure you have the correct access rights
and the repository exists.”(如下图所示)
这里写图片描述
原因:本地Git仓库和GitHub仓库之间的传输是通过SSH加密的,未创建SSH Key
解决办法:创建SSH Key。
命令窗口下:$ ssh-keygen -t rsa -C “你注册Github时用的邮箱“,然后一直回车即可。回车后可在系统盘(C盘)中用户主目录里找到.ssh目录,里面有id_rsa和id_rsa.pub。(后续设置此处略去,具体参看廖雪峰Git教程>远程仓库
结果:设置后重新克隆Github上仓库,结果如下图:
这里写图片描述

2.在本地仓库运行命令“

$ git remote add origin git@github.com:the3musketeers/test.git”后,
出现“fatal: remote origin already exists.”,如下图所示:
这里写图片描述
解决办法:输入命令$ git remote rm origin
结果:
这里写图片描述

0 0