1.进入Github首页,点击New repository新建一个项目

2.填写相应信息后点击create即可
Repository name: 仓库名称
Description(可选): 仓库描述介绍
Public, Private : 仓库权限(公开共享,私有或指定合作者)
Initialize this repository with a README: 添加一个README.md
gitignore: 不需要进行版本管理的仓库类型,对应生成文件.gitignore
license: 证书类型,对应生成文件LICENSE

3.点击Clone or download会出现一个地址,copy这个地址备用。

5.接下来在本地操作,打开“终端”cd到要clone的文件下,把github上面的仓库克隆到本地 git clone https://github.com/ElaHu/Test.git

6.以上步骤以后你的本地项目文件夹下面就会多出个文件夹,该文件夹名即为你github上面的项目名,如图我多出了个Test文件夹,我们把本地项目文件夹下的所有文件(除了新多出的那个文件夹不用),其余都复制到那个新多出的文件夹下


7.接着在终端cd到这个Test目录之下,用指令上传代码。
1)git add .
2)git commit -m"hu_add"
3)git pull (如果不拉去代码可以省去这一步)
4)git push

显示上面信息即完成上传代码
网友评论