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 ...
随机推荐
- 最新版 Mysql 8.0.16 创建用户权限更新回收权限
1.创建用户语法 : create user ‘写你自己的用户名’@‘写你需要哪个IP连接你的用户(%表示所有)’ identified by ‘密码’; 案例: create user ‘wangx ...
- WOJ#4709 迷路
WOJ#4709 迷路 题目描述 dolls意外得到了一张藏宝图,于是他踏上了寻找宝藏的道路.在走了许多许多步,回到同一个位置以后,dolls确定自己迷路了.dolls十分生气,他觉得自己这么英明圣武 ...
- vue-fiters过滤器的使用
1.定义过滤器 2.使用过滤器 ...... <el-table-column prop="user_gender" align="center" lab ...
- 定制团队自己的 Vue template
一,我们使用vue-cli 可以快速初始化vue.js的项目,官方提供了webpack,pwa,browserify-sipmple,等常用template 二.置知识1,模板结构template:该 ...
- python Opencv图像基础操作
读取并显示图像 如果读取图像首先要导入OpenCV包,方法为: import cv2 读取并显示图像 img = cv2.imread("C:\test1.jpg") OpenCV ...
- 基于 SwiftUI 创建一个可删除、可添加列表项的列表
执行环境 macOS Mojave: 10.14.5 xcode: Version 11.0 beta 6 (11M392q) 预览效果 完整代码 import SwiftUI class Item: ...
- MyBatis联表查询——别名方式
在使用MyBatis你想工程时,单表操作其实是非常完美的,涉及到多表联合查询时,需要我们自己写联表的SQL语句. 我拿出项目中的部分代码作为示例, EmployeeMapper.xml: <?x ...
- Puppeteer实现自动登录
Puppeteer是用JS对Chrome Dev Tools的实现,可以用来操作Chrome浏览器,适用于爬虫.自动化等领域. 以下是自己实现自动化登录的代码(基于ES6) const puppete ...
- passwd - 密码文件
描述 Passwd 是个文本文件, 它包含了一个系统帐户列表, 给出每个帐户一些有用的信息,比如用户 ID,组 ID, 家目录, shell,等. 通常它也包含了每个用户经过加密的密码. 它通常应该是 ...
- 在eclipse中添加和删除项目
一. 将JAVA文件夹导入Eclipse中的方法: 方法一:直接将java文件夹复制,然后粘贴到项目下: 方法二:(1)打开Eclipse,点击项目的空白处,现在import: (2)现在Existi ...