1、error: failed to push some refs to ‘git@github.com:XXXX/XXXX‘

hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., ‘git pull ...‘) before pushing again.
hint: See the ‘Note about fast-forwards‘ in ‘git push --help‘ for details.
#解决方法:
git pull --rebase origin master
git push origin master

2、Your local changes to the following files would be overwritten by merge

error: Your local changes to the following files would be overwritten by merge:
protected/config/main.php
Please, commit your changes or stash them before you can merge.
#解决方法:
如果希望保留生产服务器上所做的改动,仅仅并入新配置项, 处理方法如下:
git stash
git pull
git stash pop
然后可以使用git diff -w +文件名 来确认代码自动合并的情况. 反过来,如果希望用代码库中的文件完全覆盖本地工作版本. 方法如下:
git reset --hard
git pull
其中git reset是针对版本,如果想针对文件回退本地修改,使用
git checkout HEAD file/to/restore

3、Pull is not possible because you have unmerged files

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‘.
#解决方法:
查看冲突文件
、git status也可以告诉我们冲突的文件;
Unmerged paths:
(use "git add <file>..." to mark resolution) both modified: file
、手动解决冲突,然后提交更改:
vi file
git add file
git commit -m ‘解决冲突‘ 3、项目当中实际处理时:
 git reset --hard origin/master
提示
fatal:Unbale to create '/xx/./git/index.lock' File exisit.
继续解决
cd ./git
rm -rf index.lock
git reset --hard origin/master
搞定

4、CONFLICT (content):Merge conflict in readme.txt

$ git merge feature1
Auto-merging readme.txt
CONFLICT (content):Merge conflict in readme.txt
Automatic merge failed; fix conflicts andthen commit the result.
#解决方法:
、git status也可以告诉我们冲突的文件;
# both modified: readme.txt #冲突文件为readme.txt
、查看readme.txt的内容:
<<<<<<<HEADmaster
=======fenzhi
>>>>>>> feature1
Git用<<<<<<<,=======,>>>>>>>标记出不同分支的内容,我们修改如下后保存:
master and fenzhi
、再提交:
$ git add readme.txt
$ git commit -m "hebing"

5、The branch ‘feature-vulcan‘ is not fully merged.

error:The branch ‘feature-vulcan‘ is not fully merged.
If you are sure you want to delete it, run ‘git branch -D feature-vulcan‘.
#解决方法:
强行删除,需要使用命令:
git branch -D feature-vulcan。

6、Please move or remove them before you can merge.  Aborting(先不用要,会把本地仓库全删了)

#解决方法:
git clean -d -fx ""
其中
x -----删除忽略文件已经对git来说不识别的文件
d -----删除未被添加到git的路径中的文件
f -----强制运行

最新文章

  1. 开发经验之状态机思想,分别使用了swift,OC,C,PHP语言实现
  2. Buy Tickets(poj 2828)
  3. display : -webkit-box-inline 的理解
  4. lecture7-序列模型及递归神经网络RNN(转载)
  5. NuGet使用简要说明
  6. 推送:腾迅信鸽 VS Bmob
  7. django-filter 使用Filter来筛选你的数据
  8. Java基础学习(五)&mdash;Collection
  9. Android数据绑定技术一,企业级开发
  10. 用Maven实现一个protobuf的Java例子
  11. Qt+mpg123+openal播放MP3流
  12. 《JavaScript DOM编程艺术》学习笔记(三)
  13. Java新知识系列 七
  14. SQL进阶1:case表达式的用法示例
  15. 关于Jupyter Notebook快捷操作
  16. Linux 小知识翻译 - 目录 (完结)
  17. 洛谷 P1337 [JSOI2004]平衡点 / 吊打XXX 解题报告
  18. Redis源码学习-Master&amp;Slave的命令交互
  19. 编程调节Win7/Win8系统音量的一种方法
  20. 实现对多维数组按照某个键值排序的两种方法(array_multisort和array_sort)

热门文章

  1. Log4j指定输出日志的文件
  2. (转载)图解Java多态内存分配以及多态中成员方法的特点
  3. SQL server 关于 GROUP BY 详细讲解和用法
  4. jquery 在页面上根据ID定位(jQuery锚点跳转及相关操作)
  5. Linux安装Sqoop及基础使用
  6. Apache Mesos 官方文档 V1.0
  7. 浅谈协议(二)——视频流协议 [RTP/RTCP/RTMP/HTTP_FLV]
  8. Express 中配置使用 art-template模板引擎
  9. 脚本_统计 Linux 进程相关数量信息
  10. poj 2187 Beauty Contest(平面最远点)