GitHub上传项目到远程库

GitHub上传项目到远程库
GitHub上传项目到远程库
今天把想把文件托管到GitHub仓库,但是执行一系列的命令以后,刷新GitHub网站还是没有任何更新。后来终于找到原因,原来是在执行git push前,我忘了执行git commit命令。
下面,我将列出如何实现托管项目到GitHub上的一系列步骤:
准备:注册GitHub账号,下载及安装git客户端
第1步 在GitHub上新建一个仓库testGit。

第2步 在D盘你创建的目录下右键选择Git Bash Here
,创建本地Example仓库。

第3步 输入命令git clone https://github.com/wzniou/testGit.git
,克隆 Git 的上面创建的仓库Example。

克隆的地址在GitHub网站的testGit项目中,点击Clone and download
获取:

第4步 用CD命令进入到testGit目录下,把你要上传的项目复制到该目录下,然后输入git status
看哪些修改被暂存到了, 哪些没有, 哪些文件没有被Git tracked到。

第5步 使用git add .
将修改的信息添加到索引库中。如果只提交个别文件,使用git add 文件名
。输入git status
看到绿色的文件都已经被暂存了。

第6步 通过git commit -m 'web.xml'
来提交提交暂存区的所有文件到本地仓库。

第7步 最后执行git push origin master
将本地的master分支推送到origin主机的master分支。

最后可以在GitHub上看到刚才push的文件: