Git---报错:git Please move or remove them before you can merge 解决方案
场景:
当前在本地仓库lucky,因修改了123.txt的文件内容,需要将lucky分支push到远程Git库,在push前有其他的同事已删除了远程Git库中的123.txt文件。因此这时就产生了远程仓库与本地仓库不匹配,因此push不成功会报错。
问题的产生:
本地代码Git push origin xxx到远程仓库时,报错:git Please move or remove them before you can merge
原因:
远程仓库与本地仓库不匹配,远程仓库比本地仓库更新(团队中的其他人向此仓库提交了内容)
解决方案:
(1)push前,优先拉取远程的xxx分支到本地。与本地分支的内容进行合并
Git pull --rebase origin xxx
(2)再次push
Git push origin xxx
更简单的解决方案,需要慎用。
git clean -d -fx ""
x -----删除忽略文件已经对git来说不识别的文件
d -----删除未被添加到git的路径中的文件
f -----强制运行
Git---报错:git Please move or remove them before you can merge 解决方案的更多相关文章
- 解决git冲突造成的Please move or remove them before you can merge
git clean -d -fx “” 其中x —–删除忽略文件已经对git来说不识别的文件d —–删除未被添加到git的路径中的文件f —–强制运行如果你确定这货已经没用了,并且git status ...
- git冲突Please move or remove them before you can merge
解决Git冲突造成的Please move or remove them before you can merge git clean -d -fx ""其中x -----删除忽略 ...
- git 提示 Please move or remove them before you can merge 解决办法
解决Git冲突造成的Please move or remove them before you can merge git clean -d -fx其中x -----删除忽略文件已经对git来说不识别 ...
- git Please move or remove them before you can merge. 错误解决方案
git pull 时 往往会遇到各种各样的问题 ,下面是常遇到的一种状况 Updating 7c9e086..936acacerror: The following untracked working ...
- Updates were rejected because the remote contains work that you do(git报错解决方案)
Updates were rejected because the remote contains work that you do(git报错解决方案) 今天向GitHub远程仓库提交本地项目文件时 ...
- git报错:'fatal:remote origin already exists
git报错:'fatal:remote origin already exists'怎么处理?附上git常用操作以及说明. git添加远程库的时候有可能出现如下的错误, 怎么解决? 只要两步: 1 ...
- Git报错 bad numeric config value '100000' for 'pack.windowmemory': out of range
Git报错 bad numeric config value '10240M' for 'pack.windowmemory': out of range $ git config --edit -- ...
- 记Git报错-refusing to merge unrelated histories
记Git报错-refusing to merge unrelated histories 系统:win7 git版本: 2.16.2.windows.1 问题 1.本地初始化了git仓库,放了一些 ...
- linux git 报错提示 fatal: 'origin' does not appear to be a git repository 解决办法
输入: git pull origin master git报错提示 fatal: 'origin' does not appear to be a git repository fatal: Cou ...
随机推荐
- centos docker 修改默认存储路径
1.修改配置 将--graph /mnt/docker添加在docker.service文件中的ExecStart字段后面,其中/mnt/docker为你需要修改的存储目录 $ vim /usr/li ...
- xticks,yticks
原本的图片如下所示: 如果加上这样的语句: import matplotlib.pyplot as plt plt.xticks([]),plt.yticks([]) 显示结果就为:
- Python/C++ in Visual Studio: An Alternative to Matlab/MEX
来自Andrew Delong的博客 http://andrewdelong.wordpress.com/2012/11/03/pythonc-in-visual-studio-an-alternat ...
- [转帖]Hive基础(一)
Hive基础(一) 2018-12-19 15:35:03 人间怪物 阅读数 234 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接 ...
- eclipse设置text file encoding UTF-8和文件的换行符 Unix 格式
阿里华山版java开发手册代码格式第10条: 步骤:1.Window - Preferences, 2.左边选择 General - Workspace , 3.右边Text file encodin ...
- HTML5 Notification
H5的Notification特性 Web桌面通知 Notification API的通知接口用于向用户配置和显示桌面通知. 生产环境仅支持https下使用:否则会被默认禁止.开发环境可以在local ...
- 单选按钮(CheckBox)
import React, { useState, useEffect } from 'react' import PropTypes from 'prop-types' import _ from ...
- Spring Cloud Alibaba学习笔记(12) - 使用Spring Cloud Stream 构建消息驱动微服务
什么是Spring Cloud Stream 一个用于构建消息驱动的微服务的框架 应用程序通过 inputs 或者 outputs 来与 Spring Cloud Stream 中binder 交互, ...
- hdu 2539 虽然是水题 wa了很多次 说明自己的基本功不扎实 需要打好基础先 少年
两点吧 1.gets使用的时候 确保上一次的回车符对其没有影响 getline也是如此 这样的细节.. 多注意啊!! 2.编写程序的时候 对一些极端的情况要多调试 比如此题当 n==1的时候.. ...
- python绘图之turtle库函数的用法
Turtle库是Python语言中一个很流行的绘制图像的函数库,想象一个小乌龟,在一个横轴为x.纵轴为y的坐标系原点,(0,0)位置开始,它根据一组函数指令的控制,在这个平面坐标系中移动,从而在它爬行 ...