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 -----强制运行

Git错误总结的更多相关文章

  1. git 错误:

    git  错误: $ git commit -afatal: Unable to create 'e:/git/Android/XXXXXX/.git/index.lock': File exists ...

  2. Git错误non-fast-forward后的冲突解决

    Git错误non-fast-forward后的冲突解决当要push代码到git时,出现提示: error:failed to push some refs to ... Dealing with “n ...

  3. Git错误non-fast-forward

    Git错误non-fast-forward后的冲突解决 [日期:2012-04-21] 来源:Linux社区  作者:chain2012 [字体:大 中 小]   当要push代码到git时,出现提示 ...

  4. git错误:fatal: Not a git repository (or any of the parent directories): .git

    git错误:fatal: Not a git repository (or any of the parent directories): .git 我用git add file添加文件时出现这样错误 ...

  5. 6种常见的Git错误以及解决的办法

    我们都会犯错误,尤其是在使用像Git这样复杂的东西时.如果你是Git的新手,可以学习如何在命令行上开始使用Git.下面介绍如何解决六个最常见的Git错误. Photo by Pawel Janiak  ...

  6. Ubuntu下安装mod_python报错(GIT错误)

    Ubuntu下安装mod_python3.4.1版本报出如下错误: writing byte-compilation script '/tmp/tmpE91VXZ.py' /usr/bin/pytho ...

  7. Git:错误:error:src refspec master does not match any

    新建立了一个远程仓库,想着把项目放上去.于是在项目目录上: git init 然后就添加远程库 git remote add origin xxxx.git 然后就想push: git push -u ...

  8. WebStorm中将Project分享到GitHub时报“Error Running Git”错误的解决办法

    错误信息 Cannot run program "git.exe":CreateProcess error=2,系统找不到指定的文件. 解决办法 从错误信息就可以知道,WebSto ...

  9. git 错误

    1  执行  Git add  somefile 的时候,出现 如下 错误: If no other git process is currently running, this probably m ...

  10. Git错误一例

    Bitbucket一直不稳定,push, pull经常失效.幸好还有goagent可以用. 把git的全局配置改为走goagent代理,可以正常使用: [http] proxy = http://12 ...

随机推荐

  1. new String创建了几个对象

    String str = new String(“abc”)  到底创建了几个对象? 首先String str是定义了一个字符串变量,并未产生对象,=不产生对象,那么只有后面的new String(& ...

  2. HDFS网络拓扑概念及机架感知(副本节点选择)

    网络拓扑概念 在本地网络中,两个节点被称为“彼此近邻”是什么意思?在海量数据处理中,其主要限制因素是节点之间数据的传输速率——带宽很稀缺.这里将两个节点间的带宽作为距离的衡量标准. 节点距离:两个节点 ...

  3. [常用类]String 类

    String 字符串是常量,一旦被赋值,就不能被更改. String str = “abc”: // "abc" 可以堪称是一个字符串对象 str = “def“: // 当把 & ...

  4. JS—图片压缩上传(单张)

    *vue+webpack环境,这里的that指到vue实例 <input type="file" name="file" accept="ima ...

  5. html表格单元格添加斜下框线的方法

    一.分隔单元格的方法 1.用“transform: rotate(-55deg);”把一条水平线旋转一定角度就成斜线了 2.利用以下命令调整分割线位置等. :after :before transfo ...

  6. React框架新闻网站学习过程中遇到的错误总结

    1.安装指定版本插件命令 npm install 插件名字@1.1.4(版本号) --save 或 yarn add 插件名字@1.1.4(版本号) --dev 2.Error:‘Link’ is n ...

  7. JavaScript深入之从原型到原型链(转载)

    构造函数创建对象 我们先使用构造函数创建一个对象: function Person() { } var person = new Person(); person.name = 'Kevin'; co ...

  8. sqli-5&6

    第五关 Double Injection - Single Quotes - String (双注入GET单引号字符型注入) 1.发现前几关的方法都不能用了,要么报错(没有其他有关信息.要么什么也不出 ...

  9. Oracle 索引数据字典、基于函数的索引

    user_indexes 字典视图包含了索引名和唯一性, user_ind_columns视图包含了索引名.表名.以及列名 dba_indexes dba_ind_columns 同理 select ...

  10. opencv windows源码编译

    WITH_QT//H:\software\programming\qt\5.12.3\mingw73_32\lib\cmake  5.6的路径要改这样 WITH_OPENGL 编译器mingw32-m ...