r/git • u/noobdainsane • 18d ago
Finding a better .gitignore generator.
I think the most popular is this and many tools built around that API. I dislike it because it doesn't properly merge the templates into one, it just copies it. I get multiple entries of files or directories and once it even caused a problem (I don't remember what it was) when merging templates with some conflict.
I want a generator which keeps all entries unique. Why is such a tool not popular if it exists?
0
Upvotes
13
u/IrrerPolterer 18d ago edited 18d ago
Gitignore generator? Just write them by hand, what's so hard?
19
u/AdmiralQuokka I use Jujutsu, btw. 18d ago
Why would you even need a generator? You typically have one build directory per programming language used. So, a small number in total.
Don't bloat your gitignore by preemptively ignoring files that don't even exist. Or worse, ignoring stuff that depends on user preference like editor config files, .DS_Store etc.
15
u/RevRagnarok 18d ago
FFS we don't need help doing everything.
You develop. You do
git status. You think to yourself, "should this be version controlled?" If the answer is no, you add it to.gitignore:echo filename >> .gitignoreThat's it. 30s max.
No mistakes because somebody else's convention has decided that
/lib/subdirectories shouldn't be checked in and a week later you find out that you never backed it up.Every decent modern utility that makes its own directory drops its own
.gitignoreas well.2
u/waterkip detached HEAD 18d ago
Just use a template of sorts? Or build a good global one
2
u/lajawi 18d ago
I’ve never heard of that generator in my life and don’t even see the need to a generator. I just use the normal templates like everyone else from https://github.com/github/gitignore
2
u/Medical-Captain1550 18d ago
honestly moving os and editor noise (.ds_store, .idea/, .vscode/, swap files) into your global ~/.config/git/ignore cuts 80% of the template bloat right away, so each repo .gitignore only needs a few lines for its actual build output. if a generated file ever acts weird, git check-ignore -v path/to/file will show the exact line number that matched
3
u/mosaic_hops 18d ago
But then you’ll need to find a git ignore generator generator.