arturopala / make-it-g8

A tool to convert any project into a giter8 template
Apache License 2.0
25 stars 3 forks source link

Read global git ignore file to create a local .gitignore #2

Closed phdoerfler closed 6 months ago

phdoerfler commented 1 year ago

make-it-g8 currently checks whether there is a .gitignore file in the source directory. That's great but some people use a global gitignore file for things like ignoring target, .bloop, .metals and so on. Currently, make-it-g8 seems to completely ignore this. I think it would be a good idea to also read that ignore file if present. The location of the global gitignore file can be configured: git config --global core.excludesFile. As a workaround, one can cp $(git config --global core.excludesFile) path/to/repo/.gitignore before running make-it-g8. Maybe that would, indeed, be a good idea for make-it-g8. It is already checking whether a .gitignore is present. It might as well offer to create one using the contents of $(git config --global core.excludesFile) if present. What do you think?

arturopala commented 6 months ago

@phdoerfler, sorry for the very late reply; I might have missed the notification in the email flood. Yes, that's definitely a good idea.

arturopala commented 6 months ago

support for global .gitgnore has been released in version 1.28.0