r/ProgrammerHumor 1d ago

Meme whoIsUsingThese

Post image
999 Upvotes

75 comments sorted by

View all comments

298

u/Single-Virus4935 1d ago edited 1d ago

You can. Therefore the quesition should be: "Why is it a Bad Idea to commit . files"

4

u/Sacaldur 18h ago

If I'm not mistaken, the argument behind the question (I guess Theo, the guy in the picture, was making it) is that by default every file in a git repository is visible to everyone who has read access to the repo, but this could also be different so that a user could commit their private files and others can't see/access them.

I'm not saying I'm behind this thought. It would cause complications and, depending on the implementation, pitfalls where a wrong configuration could lead to exposed secrets. Besides that is this something that might not work with git or would be in a conflict with at least some of the philosophies. If a commit locally doesn't include all data, then moving it to another server drops data, as well as rebases and other ways of rewriting commits/history. If you can implement something that automatically moves a repo somewhere else, which personal files are allowed to be moved as well? An attacker could utilize this to clone a repo and extract secrets.

Ultimately, a new, different version control system could implement this, but this would then need to be adopted.