git 本地项目上传到github中去
2022-12-11 本文已影响0人
阿富有点愚
1.首先进入text文件夹
cd 本地项目目录
2.执行指令:git init

执行git init
初始化成功后你会发现项目里多了一个隐藏文件夹.git

3.执行指令:git add .
将所有文件添加到仓库

执行git add .
4.执行指令:git commit -m "提交文件"
双引号内是提交注释

5.到github text仓库复制仓库地址

复制仓库地址
6.执行指令:git remote add origin https://github.com/gandafu/gandf.git
git remote add [name] [url] 作用是添加远程版本库
name 是自己取的仓库的名字
url 是远程版本库地址

7.上传本地代码
执行指令:git push -u origin master

8.上传完成
可以看到我们的本地项目已经上传到了github上了。
