递归git update-index --assume-不变 [英] Recursive git update-index --assume-unchanged
问题描述
我尝试运行以下命令:
git update-index --assume-unchanged myFolderToIgnore
其中 myFolderToIgnore
是一个文件夹。然而它没有说它的无法标记它。
所以我试过:
git update-index --assume-unchanged myFolderToIgnore /
哪个GIT响应忽略路径myFolderToIgnore /
但没有做任何事情(它仍然会看到我的更改并尝试检查它们)。
<最后,我必须进入并手动将每个单独的文件标记为未更改。我在这里错过了什么?
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屋!