github入门指南(2)——推送本地文件到github上

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的网页里面获取的——对应仓库都有地址。





---

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值