this post was submitted on 11 Oct 2026
439 points (98.9% liked)

Programmer Humor

33585 readers
2302 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] Ephera@lemmy.ml 4 points 2 days ago

If you're an end user, not a build tool, you'd rather want to place that in .git/info/exclude inside the repo. It's effectively another gitignore file, which won't be committed.

But if you do need something like this for a build tool, then yeah, you can create a file /test/.gitignore with these contents:

real-person-first-last.json
.gitignore

Then running git add . just adds /test/fake-person-first-last.json.

Both /test/.gitignore and /test/real-person-first-last.json would be ignored right away.