error: failed to push some refs to 'https://github.com/.....'
2015-10-02 22:09
627 查看
执行:
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)
搞完上面的一切就成了:
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)
搞完上面的一切就成了:
相关文章推荐
- butterknife+dagger+otto+okhttp+picasso+retrofit+rxjava示例项目
- 《TCP/IP详解 卷一:协议》读书笔记--链路层
- Ubuntu 虚拟机网络问题
- 安卓控件使用系列17:ImageView获取网络图片
- Qt开发——TCP协议下的socket通信
- TCP/IP详解卷1 读书笔记:第七章 Ping程序
- http://www.linuxidc.com/Linux/2007-09/7399.htm
- Http文件传输
- 网络编程
- http协议与内容压缩
- HttpClient实现网络访问详解1
- Hiho 1232 北京网络赛 F Couple Trees
- http://www.aboutyun.com/blog-61-62.html
- Hdu 5489 合肥网络赛 1009 Removed Interval
- Hdu 5493 合肥网络赛 1010 Queue
- Hiho coder 1236 2015 北京网络赛 Score
- Coursera_Stanford_ML_ex3_多标度分类和神经网络初步 作业记录
- http://www.cnblogs.com/amboyna/archive/2008/03/08/1096024.html
- deeplearning系列(二)自编码神经网络
- Ajax获取XmlHttpRequest对象的方法,兼容IE、火狐。用来与服务器进行通信。