Ideally people who have .DS_Store, .vscode, etc. would put them into their own $GIT_DIR/info/exclude files and not pollute the shared .gitignore with stuff from their personal setup.
.gitignore Is Inherently Sisyphean
21–30 of 68 posts
Re: .gitignore Is Inherently Sisyphean
#22Ideally people who have .DS_Store, .vscode, etc. would put them into their own $GIT_DIR/info/exclude files and not pollute the shared .gitignore with stuff from their personal setup.
Excluding things like .vscode and .DS_store, which is a common and universal "don't need that in my repo", is a trivial way to reduce the burden for everyone (the goal of software, imo), maintainer included.
Re: .gitignore Is Inherently Sisyphean
#23Common pattern/solution, not a common problem. Feels equal-if-not-more Sisyphean. Also: "Oh no, my collaborative maintenance requires both collaboration and maintenance" Don't accept people playing with shotgun commits; there, problem(s) solved.
chef's kiss This is replacing one of the memes on my whiteboard rn
Re: .gitignore Is Inherently Sisyphean
#24I think people should be responsible for the litter of their own tools. If their commits have include any litter it should be rejected as they clearly aren't paying attention. The local gitignore is for project specific files.
Re: .gitignore Is Inherently Sisyphean
#25Cool post. I highly suggest using templates from https://github.com/github/gitignore for your project as they tend to include a lot of files commonly found in them - eg .idea folders and so on.
Yes-anding this to say: For per-user gitignore, one can set the following config in ~/.gitconfig: # System-wide gitignore file # To avoid in-repo repetition for system-specifc garbage files [core] excludesfile = ~/.config/git/gitignore Then your file at ~/.config/git/gitignore can be a normal format, and not need to be stored in repo. Perfect for system files (.DS_Store...) or editor swap files etc.
Re: .gitignore Is Inherently Sisyphean
#26Interesting. Makes sense for open source. In the workplace for those using common IDEs things like .vscode or .idea can definitely help with consistency or shared project setup. Each has docs which mention which files should or shouldn't be committed. Personally, I just use gitignore.io to generate the file based on my company's tooling and call it good enough.
One way of thinking about this is to note that there are an awful lot of these tools, and so each person should look after their own shit rather than fucking it up for everybody else. Another is to note that the number of these tools is finite, and team members won't be using all of them, and so over time the centralized ignore file will tend towards a useful degree of completeness.
Re: .gitignore Is Inherently Sisyphean
#27Re: .gitignore Is Inherently Sisyphean
#28Puts the onus on the committer
Re: .gitignore Is Inherently Sisyphean
#29> Luckily, you realize that you can turn the blacklist of files (the gitignore) into a whitelist, by just ignoring everything and manually un-ignoring desired files.
this will not work and tbh it's fitting a square peg in a round hole. it technically might fit if you shave off the square enough but large repos don't do this, they use a round peg: https://github.com/github/gitignore
Re: .gitignore Is Inherently Sisyphean
#30Alternatively, ignore EVERYTHING except the files you need. Puts the onus on the committer