Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
运行时git status它会在未暂存区域显示一长串已删除文件。如何阻止已删除的文件显示在未暂存区域中?
git status
已删除文件的列表来自我们不再使用的版本功能。
如何阻止已删除的文件显示在未暂存区域中?
如果你想阻止它们出现在 unstaged 区域,那么你需要告诉 Git 你不再使用它们了
rm oldfile git add oldfile git commit -m 'removed old file'
或者更好
git rm oldfile git commit -m 'removed old file'