【github使用】创建项目后上传到github

本地创建项目,同步到github,有两种方法:

(1)github上创建resp,clone到本地,该仓库作为项目,即可push和pull。

(2)本地创建项目,github上创建同名仓库,git remote add,git push -u,即可push和pull。

最近使用xcode,创建新仓库clone到本地,用xcode打开后,创建file只能创建file,无法选择template。第一种方法行不通,采用第二种方法。

进行push:git push --set-upstream origin maste,报错如下:

本地缺少远程仓库的一些work,需要pull一下。

那就pull一下:

git pull --rebase origin master

再push一下:

git push -u origin master

或者git push --set-upstream origin master

done.

 

 

参考资料:

《git官方手册》https://git-scm.com/docs/git-push

《本地初始化项目推送到github》https://blog.csdn.net/u011141492/article/details/89970189

《git push常见错误》https://blog.csdn.net/wangwangwanglichao/article/details/79983262

《git使用 将本地项目上传到github》 https://www.cnblogs.com/du-hong/p/9921214.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值