Elixir .gitignore template
The Elixir template ignores compiled bytecode, fetched dependencies and generated documentation, and covers the secret configuration files the framework convention creates.
At a glance
- Category
- Language
- Patterns in this template
- 11 rules
- Directories ignored
- 6 of the 11 rules end in a slash, so they match directories only
- Also needs an OS template
- Yes. Nothing here matches editor or file manager artefacts.
- Typical companions
- An editor template and an OS template, plus Docker if you build releases.
In detail
Almost every rule here begins with a slash, anchoring it to the directory holding the ignore file. That matters in an umbrella project, where each application has its own _build and deps: the root ignore file covers the root ones, and the anchoring keeps the intent explicit rather than relying on a rule that happens to match everywhere.
/_build holds compiled bytecode organised by environment, so a project ends up with separate dev, test and prod trees. /deps holds the fetched source of every dependency. Both are rebuilt from the mix file and the lockfile, and the lockfile is the one you commit: it pins exact versions and hashes so a fetch today matches a fetch next year.
*.beam is the compiled bytecode format for the virtual machine, and *.ez is a packaged archive of beam files. erl_crash.dump is the crash dump written when the runtime terminates abnormally. It contains the state of every process at the moment of death, including message queues, which can easily include user data or a token that was in flight.
/config/*.secret.exs is the important one. The convention is that a secret config file holds the database password, the endpoint signing salt and any third party keys, imported by the environment specific config. Ignoring it is right, and the companion habit is to commit an example version with the keys present and the values blank so a new developer knows what to supply.
/priv/static is the compiled asset output for a web project: bundled JavaScript, processed stylesheets and the digest manifest. It is produced by the asset build from sources that are tracked, and committing it means every style change appears twice in the diff. .elixir_ls is the language server's working directory, holding a build of the project purely for editor features.
Examples
/_build/
/cover/
/deps/
/doc/
/.fetch
erl_crash.dump
*.ez
*.beam
/config/*.secret.exs
.elixir_ls/
/priv/static/11 lines exactly as the tool writes them, before any common additions you tick.
Things that catch people out
- The leading slash anchors each rule to the file's own directory. In an umbrella project, a root ignore file with /deps does not cover apps/my_app/deps, so either drop the slash or add per application rules.
- erl_crash.dump can contain message contents and connection state. Ignoring it is correct, but a dump that was committed once should be treated as a data disclosure.
- Ignoring /priv/static wholesale can also drop files you place there by hand, such as a favicon or a robots file, if your asset pipeline does not copy them from a source directory.
Try it: .gitignore Generator
Pick one or more templates, tick the common additions you want, and copy or download the combined .gitignore.
.gitignore Generator
LOCAL · Browser-OnlyGenerate comprehensive .gitignore files by combining templates for languages, frameworks, IDEs, and operating systems
Language
Framework
IDE
OS
Build Tool
Infrastructure
Common Additions
Preview
Select templates or common additions to generate a .gitignore file.
Related .gitignore templates
All .gitignore templates →Ruby .gitignore template
The Ruby template anchors most rules to the repository root with a leading slash, and ignores Gemfile.lock, which is right for a gem and wrong for an app.
Haskell .gitignore template
What the Haskell template covers: object and interface files, the dist output directories, profiling and event log output, and the local project overrides.
Docker .gitignore template
A small template with two rules worth questioning: it ignores .dockerignore, and it ignores every compose file except two, which suits few projects.
Jupyter Notebook .gitignore template
The Jupyter template ignores autosave checkpoints and profile folders, but the real problem with notebooks in git is the output cells, which no rule fixes.
Laravel .gitignore template
The Laravel template ignores environment files, application keys, compiled assets and editor folders, and it is the most secret aware template here.
Node.js .gitignore template
The longest JavaScript oriented template: dependency directories, every package manager's debug log, bundler caches, env files and Yarn Plug'n'Play state.
Tools for this
- .gitignore Generator Generate .gitignore files for any project - 50+ templates for languages, frameworks, IDEs, and OS
- .env Editor & Validator Edit and validate .env files online - detect duplicates, mask secrets, generate .env.example