Best practice of adding .gitignore to repo

What is the best practice regarding a .gitignore file with Git; should it be excluded from the repository or included? If this is conditional, what are the conditions for each circumstance?

+56
git gitignore
Jul 08 2018-11-14T00:
source share
1 answer

They should almost always be included, as their goal is to ignore the "output" files (compiled binaries, log files) that will be created by someone working with a clone of your project. They are intended for version control and are included in the repository.

You should not use .gitignore files in the repository to ignore files that are displayed only for you, such as page-specific swap files. You must place these rules in the global .gitignore file .gitignore that they apply to all repositories or in .git/info/excludes .

+71
Jul 08 2018-11-11T00:
source share



All Articles