Reputation: 7649
I'm new to Haskell and Stack. When creating a new project using stack new
which files should be checked in to git (or any other VCS)? The whole dir?
Upvotes: 10
Views: 2157
Reputation: 34398
You should check in stack.yaml
, either package.yaml
(if your project has it) or your-project-name.cabal
(if it hasn't), and Setup.hs
, as they are necessary for building your project in a reproducible way. The src
, app
and test
directories should also be committed, as they in principle are where your source code will live (you can of course rearrange the structure of the default project if you wish to do so). On the other hand, you should ignore the .stack-work
directory, as it contains the build output and other volatile pieces of data.
Upvotes: 10
Reputation: 12813
You can have a look at the recommended Haskell .gitignore
on GitHub:
dist
dist-*
cabal-dev
*.o
*.hi
*.chi
*.chs.h
*.dyn_o
*.dyn_hi
.hpc
.hsenv
.cabal-sandbox/
cabal.sandbox.config
*.prof
*.aux
*.hp
*.eventlog
.stack-work/
cabal.project.local
cabal.project.local~
.HTF/
.ghc.environment.*
If you run the stack new --bare yesod-mysql
stack template it includes the following .gitignore
:
.stack-work/
yesod-mysql.cabal
*~
Upvotes: 4