【问题标题】:What to ignore in Git with Cowboy / erlang.mk project?在带有 Cowboy / erlang.mk 项目的 Git 中要忽略什么?
【发布时间】:2017-07-17 20:10:10
【问题描述】:

在学习 Erlang 时,我正在关注 Cowboy's HTTP framework documentation to setup a simple server。我了解项目结构由erlang.mk 驱动。现在有了一些工作,我想将代码提交到 Git 存储库。 .gitignore 文件的推荐条目是什么?我做了一点谷歌搜索,但找不到任何指南。

我的猜测和考虑是:

## From GitHub template:
.eunit
deps
*.o
*.beam
*.plt
erl_crash.dump
ebin/*.beam
rel/example_project   # Is this a template?
                      # Shouldn't I ignore entire rel directory?
.concrete/DEV_MODE
.rebar

## erlang.mk specific?
_rel                  # Not sure what this is, but looks generated.
*.d                   # These are generated by Make, right?
.erlang.mk            # It is referred to as temp directory in erlang.mk file.

这有意义吗?

【问题讨论】:

    标签: git erlang gnu-make gitignore cowboy


    【解决方案1】:

    我假设你已经找到了this .gitignore on github。

    请注意,您不想排除rel,因为那里的配置文件将成为您发布的一部分。根据经验,忽略隐藏文件、带有_ 前缀、deps、ebin 的目录。因此,您的忽略文件看起来不错,除了 rel 上的条目。只要您开始使用common_test 编写测试,我还将包括logs。

    另外,由于你没有使用rebar,你也可以删除.rebar。

    【讨论】:

    • 只是为了确定:应该忽略整个ebin 目录?目前我有一些.beam 文件和cowboy_playground.app 文件,它们似乎在我构建时重新生成。 GitHub 模板只忽略ebin/*.beam。
    • 所以,这就是我最终拥有的:github.com/lzrski/cowboy-playground/blob/master/.gitignore 希望它会帮助其他人:)
    • 关于ebin/:如果你自己把文件放在那里,你应该只排除ebin/*beam。但是请注意 erlang.mk takes care 为您生成 ebin/*.app 文件;来自 Makefile 或来自 src/*.app.src 文件。如果我需要一个自定义的.app 文件,我会使用第二种方法,因为它可以将代码与编译的实体巧妙地分开。
    猜你喜欢
    • 2014-11-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-08
    • 2010-10-06
    • 1970-01-01
    • 2010-12-01
    相关资源
    最近更新 更多