本地电脑连接gitHub账号

关联


1、ssh-keygen -t rsa -C "[email protected]"

一路回车 把生成的公钥id_rsa.pub内容复制到

2、登陆自己的GitHub账号上,右上角个人头像下拉选择“ settings”,选择SSH and GPG keys点击new SSH key

3、复制1生成的内容到key项  title随便写

GITHub上新建地址new repository

进入本地项目目录
取消本地目录下关联的远程库:git remote remove origin
#git初始化
git init
#将本地的origin仓库关联到远程remote仓库
git remote add origin [email protected]:loveme1413/xx.git 
#将全部文件加入git版本管理 .的意思是将当前文件夹下的全部文件放到版本管理中
git add .
#提交文件 使用-m 编写注释 
git commit -m "注释"
#推送到远程分支
git push -u origin master

 Branch 'master' set up to track remote branch 'master' from 'origin'.

猜你喜欢

转载自blog.csdn.net/loveme888/article/details/105070327
今日推荐