注:在执行下面的流程之前需要在github上新建一个空的仓库
1.首先要先下载git(若机器上没有装git的话)下载git地址:https://git-scm.com/download/
2.进入提交的根文件夹下,右键-》“git bash here”
3.由于是要提交到新的仓库上去,所以一般情况下根目录下是没有.git文件夹的,需要执行 git init
4.git add . 将根目录下的文件全部添加上去
5.若没有绑定邮箱和用户名的话 需要执行
git config --global user.email "邮箱地址"
git config --global user.name "github用户名"
6.git commit -m "提交的提示信息"
7. git remote add orgin https://github.com/puxiaoruo/Test1/blob/master/test.txt(仓库在github上的地址)
8.git push -u origin master 将本地代码push到github上去
在整个过程中若出现错误提示:
error: src refspec master does not match any.
error: failed to push some refs to
那是因为没有提交用户邮箱和用户名,需要执行5