Git错误总结
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、项目当中实际处理时:
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错误总结的更多相关文章
- git 错误:
git 错误: $ git commit -afatal: Unable to create 'e:/git/Android/XXXXXX/.git/index.lock': File exists ...
- Git错误non-fast-forward后的冲突解决
Git错误non-fast-forward后的冲突解决当要push代码到git时,出现提示: error:failed to push some refs to ... Dealing with “n ...
- Git错误non-fast-forward
Git错误non-fast-forward后的冲突解决 [日期:2012-04-21] 来源:Linux社区 作者:chain2012 [字体:大 中 小] 当要push代码到git时,出现提示 ...
- 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添加文件时出现这样错误 ...
- 6种常见的Git错误以及解决的办法
我们都会犯错误,尤其是在使用像Git这样复杂的东西时.如果你是Git的新手,可以学习如何在命令行上开始使用Git.下面介绍如何解决六个最常见的Git错误. Photo by Pawel Janiak ...
- Ubuntu下安装mod_python报错(GIT错误)
Ubuntu下安装mod_python3.4.1版本报出如下错误: writing byte-compilation script '/tmp/tmpE91VXZ.py' /usr/bin/pytho ...
- Git:错误:error:src refspec master does not match any
新建立了一个远程仓库,想着把项目放上去.于是在项目目录上: git init 然后就添加远程库 git remote add origin xxxx.git 然后就想push: git push -u ...
- WebStorm中将Project分享到GitHub时报“Error Running Git”错误的解决办法
错误信息 Cannot run program "git.exe":CreateProcess error=2,系统找不到指定的文件. 解决办法 从错误信息就可以知道,WebSto ...
- git 错误
1 执行 Git add somefile 的时候,出现 如下 错误: If no other git process is currently running, this probably m ...
- Git错误一例
Bitbucket一直不稳定,push, pull经常失效.幸好还有goagent可以用. 把git的全局配置改为走goagent代理,可以正常使用: [http] proxy = http://12 ...
随机推荐
- 构造函数与new的汇编实现
this指针,通常是通过ecx传递:gcc是通过堆栈传递的,是最后一个被压栈.传递this指针是为了访问成员变量.除了虚函数,所有成员函数被编译之后都是全局函数.mov eax,[ecx] ; 将第一 ...
- 问题 B: 傻鸡抓大闸蟹
问题 B: 傻鸡抓大闸蟹 时间限制: 1 Sec 内存限制: 128 MB提交: 94 解决: 39[提交] [状态] [命题人:jsu_admin] 题目描述 背景又到了吃大闸蟹的季节,黄老师想 ...
- .NET的优点(转载)
一:什么是.NET?它包括什么? .Net是为简化在第三代因特网的高分布式环境下的应用程序开发,基于开放互联网标准和协议之上,实现异质语言和平台高度交互性,而构建的新一代计算和通信平台. .Net主要 ...
- Java 遇到的困难
(1)需求:xml 转 json 依赖的包:commons-beanutils-1.8.3.jarcommons-collections-3.2.1.jarcommons-lang-2.6.jarco ...
- c# Winform 调用可执行 exe 文件
c#是一个写windows桌面小工具的好东西,但有个时候,我们需要在 winform 程序中调用其他的 exe 文件,那么该如何实现呢? 如果只是拉起一个 exe 文件,可以参考如下方法实现: str ...
- linux下挂载U盘方法
1.使用 cat /proc/partitions 查看系统现在有哪些分区:[root@localhost ~]# cat /proc/partitions major minor #blocks ...
- #10042. 「一本通 2.1 练习 8」收集雪花 || 离散化 || 双指针法 || C++ || LOJ
题目:#10042. 「一本通 2.1 练习 8」收集雪花 看到网上没有这道题的题解,所以写一下. 要标记数字是否存在,看到x<=1e9,所以考虑用离散化,然后开一个last数组,last[i] ...
- 解决安装mysql-connector-odbc-5.3.2 错误1918……不能加载安装或转换器库……的BUG
还是在虚拟机Windows Server 2003上安装mysql-connector-odbc-5.3.2,装着装着就报错了,大致是“错误1918……不能加载安装或转换器库……”,问我Retry,I ...
- MySQL数据库的自动备份与数据库被破坏后的恢复1
一.前言: 当数据库服务器建立好以后,我们首先要做的不是考虑要在这个支持数据库的服务器运行哪些受MySQL提携的程序,而是当数据库遭到破坏后,怎样安然恢复到最后一次正常的状态,使得数据的损失达到最小. ...
- mybatis返回新增对象的主键
加这两行就可以返回这个插入对象的自增的主键<insert id="insertSeatPortraitData" parameterType="seatPortra ...