本地项目向github提交项目

背景

由于项目的需要所以需要把项目放到gitbub上,所以小编就研究了一下如何把项目放到github上。下面是具体的步骤


前提

1有github的账号
2注册过git


步骤

1登陆自己的账号
本地项目向github提交项目_第1张图片
本地项目向github提交项目_第2张图片


2到自己针对上传项目的根目录
本地项目向github提交项目_第3张图片


3摁住ctrl+右键
本地项目向github提交项目_第4张图片


4初始化本地仓库

git init

5添加所有

git add .

6查看一下状态,是否提交成功

git status

7提交文件,把本地仓库暂存区的文件提交到仓库

git commit -m "message"

5关联远仓库

git remote add origin https://github.com/JudyWang88/judytest.git

6 push文件

git push -u origin master

本地项目向github提交项目_第5张图片

然后就完成了,项目就推上去了,嘿嘿。但其实上过程还是遇到很多问题的

github提交图片

https://blog.csdn.net/Cassie_zkq/article/details/79968598


问题

第一个错误

fatal: Authentication failed for ‘https://github.com/JudyWang88/judytest.git/’
解决方案
https://blog.csdn.net/hufeng_5961107/article/details/69061462
后者是用户名和密码错误,在github上修改一下就可以了

第二个错误

本地向github推项目出现fatal: remote origin already exists
解决方案:https://blog.csdn.net/top_code/article/details/50381432

退出vim保存
https://blog.csdn.net/taquguodedifang/article/details/77671058

第三个错误
(e.g., ‘git pull …’) before pushing again

https://blog.csdn.net/lplife/article/details/79818097


总结

感觉自己棒棒的,哈哈超级开心。我怎么可以这么优秀呢??嘿嘿

你可能感兴趣的:(本地项目向github提交项目)