本地git与远程仓库关联
现象
git push -u origin master
Warning: Permanently added the RSA host key for IP address '127.0.0.1' to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
将本地的公钥拷贝出来
- cd ~
- cd .ssh
- id_rsa.pub里的内容拷贝出来
粘贴到远程仓库
本地创建工程与远程仓库进行关联
本地创建工程
- 随意的本地创建一个工程 LeetCode
- 使用git init初始化为git仓库
- 使用git add增加一次改动
- 使用git commit -m update提交一次改动
远程创建仓库
- 在github上新建仓库
- 工程名和本地一致