git 合并时的 DIRTY_INDEX
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16880747/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
DIRTY_INDEX at merge
提问by Erel Segal-Halevi
I fetched some updates from upstream, merged, and got the following error message:
我从上游获取了一些更新,合并,并收到以下错误消息:
FAILED: DIRTY_INDEX [filename]
After a reset and another merge, I get this error:
重置和另一次合并后,我收到此错误:
FAILED: DIRTY_WORKTREE [another-filename]
All this is cryptic to me - what should I do now?
这一切对我来说都是神秘的——我现在该怎么办?
采纳答案by VonC
As mention ed in "Fun with keeping local changes around":
正如“保持本地更改的乐趣”中所述:
Linus often performs patch applications and merges in a dirty work tree with a clean index.
- A dirty work tree is where you have changes that are not added to the index.
A work tree that is not dirty is a clean work tree.- A dirty index is where you have changes already added to it (in other words, "
git diff --cached
" will report some changes).
A clean index matches theHEAD
.
Linus 经常执行补丁应用程序并在带有干净索引的脏工作树中合并。
- 脏工作树是您具有未添加到索引的更改的地方。
不脏的工作树是干净的工作树。- 脏索引是您已经添加更改的地方(换句话说,“
git diff --cached
”将报告一些更改)。
干净的索引与HEAD
.
Each time, git status
can display what you need to do before being able to do a new merge.
每次,git status
都可以显示您在进行新合并之前需要执行的操作。
git stash
, for instance, can save current work in progress in your working tree, and git stash pop
will apply said work once the merge is done.
git stash
例如,可以在您的工作树中保存当前正在进行的工作,并git stash pop
在合并完成后应用所述工作。
回答by BruceWayne
I also had the same problem. My suggestions for the solution would be: 1. Before checking out the project from origin, make sure in the Project tab, the Build Automatically option is turn off. And try merge with the other branch.
我也有同样的问题。我对解决方案的建议是: 1. 在从源代码检出项目之前,确保在“项目”选项卡中,“自动构建”选项已关闭。并尝试与其他分支合并。