Re: Automatically Add .gitignore Files
From: Junio C Hamano <hidden>
Date: 2017-02-08 23:47:12
Thangalin [off-list ref] writes:
I frequently forget to add .gitignore files when creating new .gitignore files. I'd like to request a command-line option to always add .gitignore files (or, more generally, always add files that match a given file specification).
That is essentially what "Untracked files" listing in the editor buffer given to you when you type "git commit" is about. By not saying you ignore .gitattributes, .gitignore, .gitmodules, etc., you are reminded if you forgot to add them. "git status" does the same, and perhaps you want to make it a habit to run it before committing. I am tempted to say that there should be a way to somehow forbid use of the "-m" option to "git commit" by default, until the user gains more familiarity with use of Git. That way, they will learn to pay more attention to the "Untracked" and "Changes not staged" sections ;-)