本地使用git时遇到问题及解决方案总结

1.git push origin master 后,终端上出现错误信息: push失败,原因多半是因为github上远程仓库中有Reademe.md文件

解决方法:先 git pull --rebase origin master 或者 git pull origin master后,再进行git push origin master

 

2.git remote rm origin 取消本地仓库与远程仓库的关联

 

3.git remote add origin + SSH(你的远程仓库ssh,在github上查看)  关联远程仓库

图解:

  Git本地操作相关介绍

(图上是我本人的git SSH, 请勿直接照搬)

 

4.git config --global user.name "(你的github账号名)"

   git config --global user.email "(你的github绑定的邮箱)"

上述两步为配置本地git账户

 

5.git remote -v 查看远程仓库关联

 

总结:在学习git的使用上踩了一些坑,现总结如上一些指令,希望大家可以借鉴

相关文章:

  • 2021-10-19
  • 2021-05-24
  • 2021-07-27
  • 2021-04-01
  • 2021-08-06
  • 2021-09-29
  • 2022-12-23
猜你喜欢
  • 2021-12-27
  • 2021-08-24
  • 2021-12-07
  • 2021-09-09
  • 2021-07-31
  • 2021-09-15
  • 2021-12-06
相关资源
相似解决方案