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 ...
随机推荐
- spring-data-redis的使用/redis缓存
1.导入依赖 <properties> <junit.version>4.12</junit.version> <spring.version>4.2. ...
- [2019杭电多校第七场][hdu6646]A + B = C(hash)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6646 题意为求a*10x+b*10y=c*10z满足公式的任意一组解x,y,z. 因为c有可能会由a+ ...
- Monitor HDU6514 二维差分入门学习
Monitor HDU 6514 二维差分入门学习 题意 小腾有\(n*m\)的田地,但是有小偷来偷东西,在一片矩形区域上,有一部分区域是监控可以覆盖到的,这部分区域由一个或多个包含于该矩形区域的小矩 ...
- web框架的本质(使用socket实现的最基础的web框架、使用wsgiref实现的web框架)
import socket def handle_request(client): data = client.recv(1024) client.send("HTTP/1.1 200 OK ...
- 20191115PHP cookie登入实例
首先是登入页面 <form action="" method="post"> <input type="text" nam ...
- [书接上一回]在Oracle Enterprise Linux (v5.7) 中安装DB - (1/4)
在上一回中,我们安装了OEL了,现在就要安装Oracle数据. 首先登录root用户,输入账号密码或,输入命令行:startx,启动图形界面. 先将虚拟机中插入光碟(Enterprise-R5-U7- ...
- 行人重识别(ReID) ——数据集描述 DukeMTMC-reID
数据集简介 DukeMTMC 数据集是一个大规模标记的多目标多摄像机行人跟踪数据集.它提供了一个由 8 个同步摄像机记录的新型大型高清视频数据集,具有 7,000 多个单摄像机轨迹和超过 2,700 ...
- 2019-3-6-WPF-使用-SharpDX
title author date CreateTime categories WPF 使用 SharpDX lindexi 2019-03-06 16:52:37 +0800 2018-4-20 9 ...
- sysbench github & manual
sysbench github https://github.com/akopytov/sysbench sysbench-manual.pdf https://github.com/mrivandu ...
- thinkphp 响应对象response
1.可以通过修改配置文件的 default_return_type修改输出类型 // 默认输出类型 'default_return_type' => 'html', 2. 可以通过Config类 ...