Skip to content

Latest commit

 

History

History
109 lines (55 loc) · 4.31 KB

git-gitignore.md

File metadata and controls

109 lines (55 loc) · 4.31 KB

Git: gitignore configuration

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.

Table of contents

Default starting point for a repository's .gitignore

⇑ Back to TOC ⇑

Please use the latest release of the follwing file as default for a .gitignore of any unspecific git repository:

https://www.toptal.com/developers/gitignore/api/git,vim,linux,macos,windows,jetbrains+all,visualstudiocode

Reasoning

⇑ Back to TOC ⇑

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:

How to add repository-specific files to ignore

⇑ Back to TOC ⇑

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.

Ecosystem-specific .gitignore additions

⇑ Back to TOC ⇑

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.

Ansible

⇑ Back to TOC ⇑

For Ansible-based projects (including roles and collections), it is recommended to extend our default .gitignore with the following templates:

  • python
  • ansible

URL: https://www.toptal.com/developers/gitignore/api/git,vim,linux,macos,windows,jetbrains+all,visualstudiocode,python,ansible

Django

⇑ Back to TOC ⇑

For Django-based projects, it is recommended to extend our default .gitignore with the following templates:

  • python
  • django

URL: https://www.toptal.com/developers/gitignore/api/git,vim,linux,macos,windows,jetbrains+all,visualstudiocode,python,django

Hugo

⇑ Back to TOC ⇑

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

URL: https://www.toptal.com/developers/gitignore/api/git,vim,linux,macos,windows,jetbrains+all,visualstudiocode,node,hugo