git-推送不上去发生错误

To https://github.com/........ ! [rejected]        master -> master (fetch first)error: failed to push some refs to 'https://github.com/........'hint: Updates were rejected because the remote contains work that you dohint: not have locally. This is usually caused by another repository pushinghint: to the same ref. You may want to first integrate the remote changeshint: (e.g., 'git pull ...') before pushing again.hint: See the 'Note about fast-forwards' in 'git push --help' for details.

解决办法有两种
第一招:先拉再推
第二招:无视规则
我直接使用第二招,比较快速直接盖过去,因为我在gitHub不小心添加版本纪录与更改密码。也跟本地端不同步因为gitHub里面多一个版本,使用git push -f就解决了,将原先的纪录覆盖掉。

【状况题】怎么有时候推不上去…


关于作者: 网站小编

码农网专注IT技术教程资源分享平台,学习资源下载网站,58码农网包含计算机技术、网站程序源码下载、编程技术论坛、互联网资源下载等产品服务,提供原创、优质、完整内容的专业码农交流分享平台。

热门文章