kes@work ~/t/etc $ git rm local.conf
The following pathspecs didn't match any eligible path, but they do match index
entries outside the current sparse checkout:
local.conf
hint: Disable or modify the sparsity rules if you intend to update such entries.
hint: Disable this message with "git config advice.updateSparsePath false"
早些時候我做了: git update-index --skip-worktree etc/local.conf
怎么Disable or modify the sparsity rules辦?
uj5u.com熱心網友回復:
這些提示適用于不會直接發出核心命令的新手。
skip-worktree是用于標記提交中但不屬于結帳的路徑的內部標志。Git 有一個便利設施,“稀疏結賬”,假設git help sparse-checkout您好奇,它允許您......好吧,只對您想要使用的路徑進行稀疏結賬,并完全忽略其他路徑中的任何內容犯罪。事實證明,這在很少有人遇到的情況下非常方便。
當索引條目亮起該標志時,Git 的內部實際上會跳過會影響或參考作業樹中路徑的每個操作,但它們會保留索引條目以提醒自己路徑越界。
假設您使用稀疏結帳工具點亮了該標志,則撰寫該提示。以您自己的方式使用標志并沒有錯,但是新手提示并沒有考慮到您,所以他們假設您正在做一些事情,而事實證明您在檔案中還沒有遇到過。
如果您想要做的是洗掉該檔案和索引條目,請先取消設定跳過作業樹標志,使用git update-index --no-skip-worktree etc/local.conf,然后git rm將按預期作業。
如果您想要做的只是洗掉索引條目,您可以直接在核心命令級別執行此操作git update-index --force-remove etc/local.conf,或者取消設定上述標志然后git rm --cached它。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/313227.html
標籤:混帐 git-checkout
