error: failed to push some refs to 'https://github.com/.....'
来源:互联网 发布:无锡市软件行业协会 编辑:程序博客网 时间:2024/06/15 06:31
执行:
git push
出现:
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/.....'hint: Updates were rejected because the tip of your current branch is behind
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.
背景:
1、一般是在git上创建了一个仓库,想把自己已有的项目推到git上,在git add . 和git commit -m "xxx"后git push 失败
2、在尝试按照提示git pull时又出现
U .gitignore
A README.md
Pull is not possible because you have unmerged files.
Please, fix them up in the work tree, and then use 'git add/rm <file>'
as appropriate to mark resolution, or use 'git commit -a'.
解决办法:
按照提示 fix them ,问题是怎么fix them。
1、你提示打开文件(是以项目的根目录为起始目录的)
U .gitignore
A README.md
2、你会看到里面会有<<<<<<和=======和>>>>>>>
其中<<<<<<<(七个小于号)和=======(七个等于号)之间的是当前分支的内容,=======(七个等于号)和>>>>>>>(七个大于号)之间的内容是合并的分支的内容。此时需要人工判断保留哪些内容,修改完成后,再将文件提交在暂存区(add操作),再commit到版本库就解决冲突了,然后就可以pull,最后就可以push了
其实整个过程就是要把你远程和本地的项目合并,开始的时候如下图:
master是本地分支master ;laisx/master是远程分支master(默认是origin/master)
搞完上面的一切就成了:
- error: failed to push some refs to 'https://github.com/.....'
- error: failed to push some refs to 'git@github.com:
- git - error: failed to push some refs to 'https://github.com/xuzhezhaozhao/Practice.git' 解决办法
- 在github上传项目遇到的问题(error: failed to push some refs to 'https://github.com/CrazyDony/text.git')
- Git提交数据失败 error: failed to push some refs to 'https://github.com/XXXXXXX/gif.git'
- Git 提交时报错 error: failed to push some refs to 'https://github.com/yibin94/shop.git'
- git push报错error: failed to push some refs to 'git@github.com:
- git push报错error: failed to push some refs to 'git@github.com:
- 【git push报错error: failed to push some refs to 'git@github.com】
- git push报错error: failed to push some refs to 'git@github.com:
- failed to push some refs to 'git@github.com怎么办
- github error: failed to push some refs to错误解决
- 解决github :error: failed to push some refs to 问题
- github commit 报错:error: failed to push some refs to 'https:'错误解决方法
- 解决git error: failed to push some refs to 'git@github.com:
- error: failed to push some refs to 'git@github.com:GoodMemery/mytest.git'
- error: failed to push some refs to 'git@github.com:yourname/repositoryname.git'
- error: failed to push some refs to git@github.com:damononliu/cv_python.git
- Django CSRF原理分析
- LAMP配置+ftp(以Ubuntu14为例)
- IOS初级:SDWebImage
- 例题5.6 井下矿工 LA5135
- Chromium与V8 (JavaScript引擎)
- error: failed to push some refs to 'https://github.com/.....'
- NY12 喷水装置(二)
- [HDU 2795]Billboard[线段树]
- 分布式系统-CH2:系统模型
- Mybatis系列(六)接口式编程
- C++ 设计模式
- Android群英传读书笔记-----控件架构
- 浏览器的工作原理:新式网络浏览器幕后揭秘
- Android进阶之设置透明、半透明等效果