递归git update-index --assume-不变 [英] Recursive git update-index --assume-unchanged

查看:89
本文介绍了递归git update-index --assume-不变的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试运行以下命令:

  git update-index --assume-unchanged myFolderToIgnore 

其中 myFolderToIgnore 是一个文件夹。然而它没有说它的无法标记它。



所以我试过:

  git update-index --assume-unchanged myFolderToIgnore / 

哪个GIT响应忽略路径myFolderToIgnore / 但没有做任何事情(它仍然会看到我的更改并尝试检查它们)。



<最后,我必须进入并手动将每个单独的文件标记为未更改。我在这里错过了什么?

解决方案

update-index 管道命令,因此不如真正的前端命令那样舒适。您必须自己处理递归位:

  git ls-files -z myFolderToIgnore / | xargs -0 git update-index --assume-unchanged 


I'm trying to run the following:

git update-index --assume-unchanged myFolderToIgnore

Where myFolderToIgnore is a folder. However it fails saying its "unable to mark" it.

So I tried:

git update-index --assume-unchanged myFolderToIgnore/

Which GIT responds to with Ignoring path myFolderToIgnore/ but doesn't do anything (it still sees my changes and tries to check them in).

In the end I had to go in and manually mark each individual file as unchanged. What am I missing here?

解决方案

update-index is an internal plumbing command and thus not as comfortable as the real front-end commands. You will have to handle the recursion bit yourself:

git ls-files -z myFolderToIgnore/ | xargs -0 git update-index --assume-unchanged

这篇关于递归git update-index --assume-不变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆