1.在github上面,新建一个仓库
然后在弹出的网页里,会看到一个网址,类似下面这样:
https://github.com/xxx-xxx/testpro.git
2.打开本地的git shell
进行如下操作:
echo "# testpro" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/xxx-xxx/testpro.git
git push -u origin master
3.推送新加入的文件到这个新建的仓库里面
(1)把文件放到这个文件夹里面
(2)使用命令
git add .
git commit -m "your commit"
git push -u origin master
4.过了一段时间,你修改了文件或增删了文件,想要推送
git add .
git commit -m "your commit"
git remote add origin https://github.com/xxx-xxx/testpro.git
git push -u origin master
[注意]:如果origin已经存在了,请使用 git remote rm origin ,然后再add origin 即可。
这里的网址,是要自己去github的网页里面获取的——对应仓库都有地址。
---