Search code examples
giterlanggnu-makegitignorecowboy

What to ignore in Git with Cowboy / erlang.mk project?


While learning Erlang I'm following Cowboy's HTTP framework documentation to setup a simple server. I understand that the project structure is driven by erlang.mk. Now having something working I want to commit the code to Git repository. What are the recommended entries for .gitignore file? I did a little googling, but couldn't find any guides.

My guesses and considerations are:

## 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.

Does it make sense?


Solution

  • I assume that you already found this .gitignore on github.

    Note that you do not want to exclude rel, as the configuration files there will be part of your release. As a rule of thumb, ignore hidden files, directories with _ prepended, deps, ebin. So, your ignore file looks good, except the entry on rel. I would also include logs, as soon as you start writing tests with common_test.

    Additionally, as you are not using rebar, you can delete .rebar as well.