美文网首页
项目上传到github的方法

项目上传到github的方法

作者: guoguojianshu | 来源:发表于2020-06-08 16:41 被阅读0次

先cd到要传的工程目录下
1.执行git init 初始化你的项目为git仓库

git init

2.执行git add . 添加所有的文件(注意".")

git add .

3.提交注释 git commit -m "first commit" (每一次提交代码到github的时候必须得写注释,否则也提交不上去)

git commit -m "first commit"

4.添加源头(你要提交的地址,第一次提交的时候才会设置,设置过了之后就不用设置了)

git remote add origin https://github.com/用户名/项目名.git

git remote add origin https://github.com/guoguozaichangge/test01.git
截屏2020-06-08 下午4.38.54.png

5.提交代码到指定的分支(你要提交的项目地址有可能有多个分支)

git push -u origin master

6.然后填写username和pasword就可以了

相关文章

网友评论

      本文标题:项目上传到github的方法

      本文链接:https://www.haomeiwen.com/subject/dqvrtktx.html