开发者

How to make .gitignore ignore compiled files with no extension? [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

gitignore without binary files

Edit: Dupe of gitignore without binary files

When you compile, say, a Haskell file, (test.hs), using ghc --make test.hs, the开发者_如何学C result is test.hi and test. I only want to add and commit the source test.hs, while keeping test.hi and test out of the repository but in the same directory as the source file. test is the problem, how do I specify to .gitignore to ignore a compiled file with no extension?


Just add the filename to your .gitignore file. For example:

$ git ls-files --other --exclude-standard
test
$ echo test > .gitignore
$ git ls-files --other --exclude-standard
$

.gitignore doesn't care about extensions. It just matches patterns.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜