The gitignore
config is used to specify intentionally untracked files. There are several places to define it. A .gitignore
file is the usual, easily accessible per-repository option which is easily shared among all developers as part of the repository itself.
- Default starting point for a repository's
.gitignore
- Repository-specific files to ignore
- Ecosystem-specific
.gitignore
additions
Please use the latest release of the follwing file as default for a .gitignore
of any unspecific git repository:
Every developer is primarily responsible for avoiding the inclusion of unwanted files in commits. However, defining defaults to ignore files generated by widely-used tools is highly beneficial. It helps prevent common mistakes in pull requests, especially from contributors who may not regularly use Git or work with the repository.
After reviewing development environments within our organization and among our peers, we have decided to ignore likely unwanted files from the following components by default:
- Git
- Linux and common tools (e.g., Thunar, Nautilus)
- macOS and common tools (e.g., Finder)
- Microsoft Windows and common tools (e.g., File Explorer)
- Vim
- Microsoft Visual Studio Code
- JetBrains Toolset (complete suite / all IDEs)
Add repository-specific excludes below the end of the Toptal templates:
# End of https://www.toptal.com/developers/gitignore[...]
### Repository-specific files
...
Use this section only for files that are not covered by Toptal's general-purpose templates.
Extend the .gitignore
file as needed for your project, based on the tools you use (e.g. Ansible, Chocolatey, certain build tools, …). You can access Toptal's .gitignore.io WebUI pre-configured with our default to easily add additional gitignore
-templates.
For Ansible-based projects (including roles and collections), it is recommended to extend our default .gitignore
with the following templates:
python
ansible
For Django-based projects, it is recommended to extend our default .gitignore
with the following templates:
python
django
For Hugo-based projects (content as well as templates), it is recommended to extend our default .gitignore
with the following templates:
node
(because we usually use Tailwind CSS for template development)hugo