How to make .gitignore ignore compiled files with no extension? [duplicate]
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.
精彩评论