Live data from Hacker News

Stop Using Git Ignore

eddiejaoude.substack.com

21–30 of 72 posts

Re: Stop Using Git Ignore

#21

Disagree. Many projects may want to commit IDE files. Ignoring them globally is simply wrong.

oh wow, really! why? sounds like a horrible project, imagine those git conflicts can you elaborate on why they would want to commit IDE generated files? I have only seen this in legacy projects what happens if people want to use different IDEs?

Jetbrains' .DotSettings file is a specific example. It contains things like project specific dictionaries for the IDE's spell checker.

Re: Stop Using Git Ignore

#22

Disagree. Many projects may want to commit IDE files. Ignoring them globally is simply wrong.

Once they're committed into the repository, they're no longer ignored, so what's the problem? The IDE files being listed in a hypothetical developer's global .gitignore do no harm in this case.

Re: Stop Using Git Ignore

#24

Earlier quoted context omitted.

yes exactly! then we end up with every IDE, operating system and dev tools (which is a lot)

Why is it a problem to have a long .gitignore?

Committing stuff to the repo means work for other people (namely the reviewers).

And to find the answer to “why is it a problem that there's a .sublimetext line in the .gitignore” then ask yourself the question “why is it a problem if there's a .sublimetext file committed to the repository”. Why even bothering to add it to the .gitignore when you can just commit the file?

Why do you think the second scenario is an issue and not the first?

Re: Stop Using Git Ignore

#26
post #16

This seems like a terrible idea.. imagine framework A that has a throwaway folder called ".blah"—now imagine framework B that has a very important configuration folder called ".blah"—so at best this would only cover IDE and OS stuff. But that stuff ends up being like what, 10 lines at most?

I am suggesting we separate project specific and developer specific git ignores - I don't think you read the article

Re: Stop Using Git Ignore

#27

Being honest, I dislike the tone of this sort of clickbaity rephrasing of the article title. The actual title is "You must use your Global Git Ignore!" which is completely true; the nuanced observation from the article "Using the git ignore feature is great but it has limitations, which is why I think this file is overused and often incorrectly" is a worthwhile hook, and presented thoughtfully. The title "Stop Using…

Thank you for the detailed feedback, I really appreciate you taking the time and effort. Yes the title is a little bit controversial

Thanks for taking the time to write the article! We need more people sharing their good ideas like this.

Re: Stop Using Git Ignore

#28
Let's hope that people who resort to clickbait titles never complain about dark patterns in software, because what they do is analogous, they're tricking me to their advantage.

Re: Stop Using Git Ignore

#30

Earlier quoted context omitted.

Yeah, people putting MacOS-specific files that have no relation to the codebase in the .gitignore should stop.

I'm not sure about that. We had a new hire once add a ton of .DS_Store files because we forgot to ignore it at the repo level and they didn't have a global ignore set up. I don't see the point of committing files that have no purpose in the repo, especially these ones, that could change between users age potentially polluting the diffs. We added it to the ignore list and removed the files

Or you could have taught them how to add the ignore file on their computer so they won't be making the same mistake in any other repo or other projects…

And you could have used the opportunity to teach them about using a version control altogether and how it they aren't supposed to just throw git commit -am "fix stuff" at every problem!

The fact that they committed the .DS_store files shows there's a much deeper problem with how this employee works that something you can work around with a .gitignore file. Now the problem has just been hidden under the rug.

Post reply on HN