一、使用https提交远程库

首先已经git commit -m “注释”

本地仓库关联远程github服务器:git remote add origin  “https://XXXX.git”

提交修改文件:git push origin master

此处需要输入用户名密码:用户名就是登陆github的用户名,密码是github的密码

如果你关联的远程仓库有文件没有pull到本地,此时需要git pull “https://XXX.git”

 

二、由https切换到ssh提交

先删除之前的http连接:git remote rm origin

添加ssh连接:git remote add origin “git://XXXX.git”

第一次提交修改文件:git push -u origin master

再次提交只要git push

ssh需要将.ssh文件夹中的公钥添加到github的Setting中SSH and GPG keys

相关文章:

  • 2022-12-23
  • 2021-10-10
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
  • 2021-12-24
  • 2021-12-12
  • 2022-12-23
猜你喜欢
  • 2021-12-07
  • 2021-05-09
  • 2021-12-06
  • 2022-12-23
  • 2021-06-03
  • 2022-02-08
  • 2021-11-27
相关资源
相似解决方案