git误区error: failed to push some refs to 'git@github.com:

浅浅的花香味﹌ 2022-05-25 01:58 254阅读 0赞

网上git入门很多,重点却总是一笔带过,总是讲一些简单命令,那些都烂大街了,再写也没意思了

先说github

创建新仓库时注意

70

不要点这个

Initialize this repository with a README

This will let you immediately clone the repository to your computer. Skip this step if you’re importing an existing repository.

这句话意思是 用一个 readme初始化这个仓库

他会使你可以立即克隆这个仓库当你的电脑,如果你要导入一个已存在的工程请跳过他

就这句话,诞生了多少错误,下面再说,接下来创建好后,他会有一个提示,如下

70 1

70 2

照着这个步骤敲,肯定能成功

放几个链接

https://www.jianshu.com/p/11859cd561c8

https://stackoverflow.com/questions/9794413/failed-to-push-some-refs-to-githeroku-com

failed to push some refs to git@heroku.com的问题大概都是这种问题

本地仓库和远程仓库不一致,除非强制上传,不过这样也不太好吧

https://jingyan.baidu.com/article/f3e34a12a25bc8f5ea65354a.html

也是这个问题,

Administrator@PC-20150110FGWU /K/cocos2d/yc (master)

$ git push -u origin master

To git@github.com:yangchao0718/cocos2d.git

! [rejected] master -> master (non-fast-forward)

error: failed to push some refs to ‘git@github.com:yangchao0718/cocos2d.git

hint: Updates were rejected because the tip of your current branch is behin

hint: its remote counterpart. Integrate the remote changes (e.g.

hint: ‘git pull …’) before pushing again.

hint: See the ‘Note about fast-forwards’ in ‘git push —help’ for details.

不想做格式了,最近有点忙,纯记录下,自己踩的坑,水货教程太多了,重点都没get到

发表评论

表情:
评论列表 (有 0 条评论,254人围观)

还没有评论,来说两句吧...

相关阅读