Is it possible to add the .gitignore file to .gitignore itself?
.gitignore
Doesn’t work though
I don’t want to see it in edited files
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
.gitignorefile’s purpose is to prevent everyone who collaborates on a project from accidentally commiting some common files in a project, such as generated cache files. Therefore you should not ignore.gitignore, since it’s supposed to be included in the repository.If you want to ignore files in just one repository but want to avoid committing the ignore list (for example for personal files) you can add them to
.git/info/excludein that repository.If you want to ignore certain files on every repository on your machine you can create the file
~/.gitignore_globaland then run