本地项目关联github

1 远程仓库路径为https://github.com/Kevin34/E****
2 本地文件夹内操作

// git init 
// git add -A
// git commit -m ''
// git remote add origin https://github.com/Kevin34/E**** 
    
 // 如果远程仓库为空的
// git push-u origin master

// 如果远程仓库不为空的
// git pull --rebase origin master
// git push origin master

// 之后就可以正常push代码了

3.  gitHub 账户  密钥绑定


       打开终端, 在中断命令行中键入$ ssh-keygen -t rsa -C "****@foxmail.com" ,邮箱是你github中使用的绑定邮箱,非github的名字,必须使用双引号将邮箱包含.

~ mac$ cat ~/.ssh/id_rsa.pub 

终端打印内容:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC69/4prg1LvUX15tZ891safU+GIE/oAvs0cQv2S5r3CkTAnYS+cT5Xtp2fJ+pVcNGi4Y4vI5scuQbAsP/tsu713eLCGHk/YOGNXVjOcIibLrBsxZ+sf4c3H8HCr48j35CWAMvYMaqO5GlrV4omURsjEfFm9/polSeE0fCMh5RDFUv472TZUAGxdRDF57HO/snSvUbs73Z1JBPbiRzEaTNdwiy3Yu/KXDNiOpDEMcTWnRSBnnnUvx8uAyDbm3S+axAv2olK0PBgAG8EfMQ4H2ZKZNI/Og7p3pQe8GG75ZamHmL00hwBabIt4OAy02O0ivQdytC8uqPh7bw/NZWGSY8b *****@foxmail.com

将密钥填写到github中.title随意. 将中断打印的内容全部填写到key对应的输入框中.点击add即可.

猜你喜欢

转载自blog.csdn.net/W_han__/article/details/102744045