忽略git中已删除的文件?
git 是否可以忽略已删除的文件? git update-index --assume-unchanged 允许我忽略修改,但它仍然跟踪删除。
(这很相似,但我找不到“John Doe”在哪里重申了他的问题:忽略 git 中修改(但未提交)的文件?)
Is it possible to ignore deleted files in git? git update-index --assume-unchanged allows me to ignore modifications, but it still tracks deletions.
(This is similar, but I couldn't find where "John Doe" restated his question: Ignore modified (but not committed) files in git?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不会尝试忽略“删除”状态,而是:
注意:这可能与当前与 SVN 同步的 Git 存储库不兼容。
Rather than trying to ignore the "delete" status, I would:
Note: that may not be compatible with a Git repo currently synchronized with a SVN one.
以下停止肯定会解决您的问题:
确保所有已删除的文件都不会暂存以提交。
如果它们已暂存,要取消暂存它们,您只需执行
git reset
在此步骤之后,运行以下命令
注意: 第一个命令。
git ls-files --deleted -z
,以字符串形式列出所有已删除的文件。然后它将其作为第二个命令的输入。The following stops will surely solve your problem:
Ensure that all deleted files are not staged to commit.
If they are staged, to unstage them you can simply do
git reset
After this step, run the following command
Note: The first command.
git ls-files --deleted -z
, lists all the deleted files as a string. Then it takes that as the input to the second command.