简体   繁体   English

Haskell堆栈和版本控制

[英]Haskell stack and version control

I'm new to Haskell and Stack. 我是Haskell和Stack的新手。 When creating a new project using stack new which files should be checked in to git (or any other VCS)? 使用stack new创建新项目时,应该将哪些文件签入git(或任何其他VCS)? The whole dir? 整个目录?

You should check in stack.yaml , your-project-name.cabal and Setup.hs , as they are necessary for building your project in a reproducible way. 您应该检查stack.yamlyour-project-name.cabalSetup.hs ,因为它们是以可重现的方式构建项目所必需的。 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). srcapptest目录也应该提交,因为它们原则上是你的源代码所在的位置(如果你愿意的话,你当然可以重新安排默认项目的结构)。 On the other hand, you should ignore the .stack-work directory, as it contains the build output and other volatile pieces of data. 另一方面,您应该忽略.stack-work目录,因为它包含构建输出和其他易失性数据。

You can have a look at the recommended Haskell .gitignore on GitHub: 您可以在GitHub上查看推荐的Haskell .gitignore

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 new --bare yesod-mysql堆栈模板,它包含以下.gitignore

.stack-work/
yesod-mysql.cabal
*~

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM