git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Automatically Add .gitignore Files
@ 2017-02-08 19:05 Thangalin
  2017-02-08 23:39 ` Junio C Hamano
  2017-02-09 10:03 ` Duy Nguyen
  0 siblings, 2 replies; 5+ messages in thread
From: Thangalin @ 2017-02-08 19:05 UTC (permalink / raw)
  To: git

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).

Replicate

0. git init ...
1. echo "*.bak" >> .gitignore
2. touch file.txt
3. git add file.txt
4. git commit -a -m "..."
5. git push origin master

Expected Results

The .gitignore file is also added to the repository. (This is probably
the 80% use case.)

Actual Results

The .gitignore file is not added to the repository.

Additional Details

At step 4, there should be a prompt, warning, or (preferably) either a
command-line or configuration option to add the .gitignore file prior
to commit, automatically. Such as:

git commit --include-all-gitignore-files -a -m "..."

Or:

echo "**/.gitignore" >> .git/config/add-before-commit

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-02-09 17:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-08 19:05 Automatically Add .gitignore Files Thangalin
2017-02-08 23:39 ` Junio C Hamano
2017-02-09  0:01   ` Stephan Beyer
2017-02-09 10:03 ` Duy Nguyen
2017-02-09 17:25   ` Thangalin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).