Git 强制将单个文件置于冲突合并状态

Git 强制将单个文件置于冲突合并状态,git,git-merge-conflict,Git,Git Merge Conflict,上游分支(不是主/默认分支,如果有关系的话)有一些我想要的更新,大多数其他差异我没有 首先,我做了git fetch-v upstream而不是pull,因为我不想修改本地代码(在我的主分支中) 执行git merge-upstream/nonmaster将自动合并许多我绝对不想要的东西,删除许多从未从我的fork上游上传的本地文件(因为它是另一个作者/助手项目),等等 问题,我如何才能让它进入这样一种状态:git mergetool将启动我配置的GUI(kdiff3),以允许我选择在所有更改的

上游分支(不是主/默认分支,如果有关系的话)有一些我想要的更新,大多数其他差异我没有

首先,我做了
git fetch-v upstream
而不是
pull
,因为我不想修改本地代码(在我的主分支中)

执行
git merge-upstream/nonmaster
将自动合并许多我绝对不想要的东西,删除许多从未从我的fork上游上传的本地文件(因为它是另一个作者/助手项目),等等

问题,我如何才能让它进入这样一种状态:
git mergetool
将启动我配置的GUI(kdiff3),以允许我选择在所有更改的文件中保留面板a(基本)/B(我的)/C(他们的)中的哪些编辑(其中一些在上游完全丢失,但我肯定要保留在我的分支中)

目前,它返回“无需合并文件”,尽管
git diff HEAD
显示了差异,显然它会自动合并。我不想要自动的;我想选择合并/更改的内容,在大多数情况下保持我的内容不变

我可以一次只做一个文件…怎么办? 比如说,
git checkout-m upstream/save--README.md
作为测试文件

包括(相关问题)在内的多个来源[请参阅git checkout-m的变体…

然而,我仍然面临着“无需合并文件”的问题,冲突解决毕竟不是强制的,而
git diff HEAD
显示了我最不希望的自动合并更改

 git status; git diff HEAD

On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        modified:   README.md


diff --git a/README.md b/README.md
index 9a7e6a0..1be114b 100644
--- a/README.md
+++ b/README.md
@@ -21,22 +21,23 @@ Setup


-Before you begin, make sure you have `Python3` installed. Robinhood shell only works with python3. Some of the functionality is broken on python2.7 
+Download Robinhood Shell by downloading the zip file ([link](https://github.com/ploch/RobinhoodShell/archive/dev.zip)) OR by using git 

-1. Download Robinhood Shell by downloading the zip file ([link](https://github.com/anilshanbhag/RobinhoodShell/archive/dev.zip)) OR by using git 
+=======

 ```
-git clone https://github.com/anilshanbhag/RobinhoodShell.git
+git clone https://github.com/ploch/RobinhoodShell.git
git状态;git差异头
论分行行长
您的分支机构是最新的“原始/主”分支机构。
要提交的更改:
(使用“git重置磁头…”取消分级)
修改:README.md
diff——git a/README.md b/README.md
索引9a7e6a0..1be114b 100644
---a/README.md
+++b/README.md
@@-21,22+21,23@@安装
-开始之前,请确保已安装“Python3”。Robinhood shell仅适用于Python3。python2.7上的某些功能已中断
+通过下载zip文件下载Robinhood Shell([link](https://github.com/ploch/RobinhoodShell/archive/dev.zip))或者使用git
-1.通过下载zip文件下载Robinhood Shell([链接](https://github.com/anilshanbhag/RobinhoodShell/archive/dev.zip))或者使用git
+=======
```
-git克隆https://github.com/anilshanbhag/RobinhoodShell.git
+git克隆https://github.com/ploch/RobinhoodShell.git
推论(可能?)

在git管道中,我们如何手动创建冲突标记,否则,
git merge
会认为它自动完成了任务?

我建议
git pull--rebase=interactive
--rebase=I
自git 2.19以来)
--no ff--no commit
手动暂存更改。但这会应用更改,不会影响合并工具的行为。我建议
git pull--rebase=interactive
--rebase=I
自git 2.19以来)
--no ff--no commit
手动暂存更改。但这会应用更改,不会影响mergetool行为。相关