1

当我这样做时,hg status我看到:

[jiewmeng@JM Code]$ hg status
M examples/SampleTestingSolution/EmptyGeneralTesting/Debug/SPA.lib
M examples/SampleTestingSolution/EmptyGeneralTesting/Debug/UnitTesting.exe
M examples/SampleTestingSolution/EmptyGeneralTesting/Debug/UnitTesting.ilk
M examples/SampleTestingSolution/EmptyGeneralTesting/Debug/UnitTesting.pdb
M examples/SampleTestingSolution/EmptyGeneralTesting/EmptyGeneralTesting.suo
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Debug/AST.obj
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Debug/CL.read.1.tlog
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Debug/CL.write.1.tlog
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Debug/DesignExtractor.obj
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Debug/Lib-link.read.1.tlog
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Debug/Lib-link.write.1.tlog
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Debug/Node.obj
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Debug/PKB.obj
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Debug/Parser.obj
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Debug/Query Evaluator.obj
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Debug/Query Processor.obj
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Debug/SPA.Build.CppClean.log
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Debug/SPA.lastbuildstate
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Debug/SPA.log
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Debug/VarTable.obj
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Debug/cl.command.1.tlog
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Debug/lib.command.1.tlog
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Debug/vc100.idb
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Debug/vc100.pdb
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/SPA.vcxproj
M examples/SampleTestingSolution/EmptyGeneralTesting/SPA/SPA.vcxproj.filters
M examples/SampleTestingSolution/EmptyGeneralTesting/UnitTesting/Debug/CL.read.1.tlog
M examples/SampleTestingSolution/EmptyGeneralTesting/UnitTesting/Debug/CL.write.1.tlog
M examples/SampleTestingSolution/EmptyGeneralTesting/UnitTesting/Debug/NodeTest.obj
M examples/SampleTestingSolution/EmptyGeneralTesting/UnitTesting/Debug/UnitTest.obj
M examples/SampleTestingSolution/EmptyGeneralTesting/UnitTesting/Debug/UnitTesting.lastbuildstate
M examples/SampleTestingSolution/EmptyGeneralTesting/UnitTesting/Debug/UnitTesting.log
M examples/SampleTestingSolution/EmptyGeneralTesting/UnitTesting/Debug/cl.command.1.tlog
M examples/SampleTestingSolution/EmptyGeneralTesting/UnitTesting/Debug/link.command.1.tlog
M examples/SampleTestingSolution/EmptyGeneralTesting/UnitTesting/Debug/link.read.1.tlog
M examples/SampleTestingSolution/EmptyGeneralTesting/UnitTesting/Debug/link.write.1.tlog
M examples/SampleTestingSolution/EmptyGeneralTesting/UnitTesting/Debug/mt.command.1.tlog
M examples/SampleTestingSolution/EmptyGeneralTesting/UnitTesting/Debug/mt.read.1.tlog
M examples/SampleTestingSolution/EmptyGeneralTesting/UnitTesting/Debug/mt.write.1.tlog
M examples/SampleTestingSolution/EmptyGeneralTesting/UnitTesting/Debug/vc100.idb
M examples/SampleTestingSolution/EmptyGeneralTesting/UnitTesting/Debug/vc100.pdb
M examples/SampleTestingSolution/EmptyGeneralTesting/UnitTesting/source/UnitTest.cpp
M examples/SampleTestingSolution/EmptyGeneralTesting/source/Parser.cpp
M examples/SampleTestingSolution/EmptyGeneralTesting/source/Parser.h
A .hgignore
? examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Debug/SPA.write.1.tlog
? examples/SampleTestingSolution/EmptyGeneralTesting/SPA/Parser.h
? examples/SampleTestingSolution/EmptyGeneralTesting/UnitTesting/Debug/UnitTesting.write.1.tlog

所以我.hgignore看起来像

syntax: glob

*.lib
*.tlog
*.log
*.obj
*.tlog
*.idb
*.pdb
*.exe
*.ilk
*.filters

当我再次执行 hg status 时,我看到输出有类似/不明显的差异。为什么?我希望所有这些都会消失hg status

4

1 回答 1

5

如果您已经添加了这些文件,则需要hg forget在应用 hgignore 指令之前“”它们。
请参阅“之间有什么区别hg forgethg remove?”:(hg remove -Afhg forget)将删除它们而不将它们从工作目录中删除。
另请参阅此线程

未跟踪的文件会在“ ”中显示一个问号hg status,除非它们与.hgignore文件匹配。

于 2012-10-30T06:28:33.037 回答