git update-index --assume-unchanged 差异在 egit 中
场景如下:
我在 eclipse + egit (git 插件)中打开了一个 git 项目,其中包含一个名为samples.xml 的资源文件。
我想删除samples.xml,但告诉git忽略更改。所以我执行以下操作:
rm samples.xml
git update-index --assume-unchanged samples.xml
这在命令行上工作得很好。 git status 不返回任何内容。
事实上,我也期望同样的结果。但是,如果我打开提交对话框,我会看到一行内容:Assume returned |
。
为什么会出现这种情况呢?如果 egit 知道它假设不变,为什么它仍然显示在提交对话框中?有解决方法吗?
谢谢,
肯
Here's the scenario:
I have a git project open in eclipse + egit (the git plugin) with a resource file called samples.xml.
I would like to remove samples.xml, but tell git to ignore the change. So I do the following:
rm samples.xml
git update-index --assume-unchanged samples.xml
This works fine and dandy on the command line. git status
returns nothing.
In egit, I would expect the same as well. However, if I open the commit dialog, I get a line that reads Assume unchanged | <path_to_samples.xml>
.
Why would this happen? If egit knows that it's assume unchanged, why does it still display in the commit dialog? Is there a workaround for this?
Thanks,
Ken
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您滥用了
--assume-unchanged
。它的意思是对 git 说我不会更改这个文件,所以不用费心去查看(这样你就可以在一些效率较低的文件系统上执行得更好)现在,你这么说,但你继续并 rm 它?话虽如此,由于 git status 尊重您的删除,egit 也应该这样做,所以您可能可以向 egit 开发人员提出这个问题,并询问他们这是否是故意的。
You are misusing the
--assume-unchanged
. It is meant to say to git that I won't change this file, so don't bother looking at ( so that you can perform better on some less than efficient filesystems ) Now, you say that, but you go ahead and rm it?With that said, since
git status
is respecting your delete, egit should do that as well, so probably you can raise this with egit developers and ask them if this was intentional.