r/ProgrammerHumor • • Oct 10 '26

Meme noWayLol

Post image
11k Upvotes

118 comments sorted by

View all comments

16

u/_ironhearted_ Oct 10 '26

I do this sometimes because I create a bunch of local files to try some things out and i don't want to clutter the actual one with weird names😂

22

u/kemitche Oct 10 '26

You can create your own, separate, local gitignore file, and tell git to use that one in ADDITION to the one in the repo!

https://git-scm.com/docs/gitignore

Then you can do whatever you want without affecting the repo's gitignore

6

u/Xexanos Oct 10 '26

TIL

This might actually be useful for my work

6

u/Firewolf06 Oct 10 '26

i have .local.gitignore as both a gitignore file and as an excluded file in my global git config, its quite nice

2

u/ozh Oct 11 '26

You have core.excludesfile=.local.gitignore ?

I have this, which works fine but I still have to add .local.ignore to the .local.gitignore...

1

u/Firewolf06 Oct 11 '26

i have that, plus .local.gitignore in ~/.config/git/ignore

1

u/ozh Oct 11 '26

It won't be of any use I think. ~/.config/git/ignore is read only if core.excludesfile isn't set