Live data from Hacker News

Stop Using Git Ignore

eddiejaoude.substack.com

31–40 of 72 posts

Re: Stop Using Git Ignore

#31

I'd rather enforce it at the repo then hope and pray everyone updates their global configs. Easy enough to catch but you'll miss some. Literally no cost to adding it to repo config either

yes as an open source maintainer, this is a difficult decision I need to make for each project. On one hand, I want to do the right thing, but on the other, the initial convenience does come into play - but this can come back to bite us later when people play the green square game on the git ignore file in the GitHub repo

Re: Stop Using Git Ignore

#32
> As a maintainer, don’t fall into the trap of putting every possible exclusion into the repo’s git ignore. This really is a “sticky plaster” approach in my view. What we should try to do is up-skill and educate the community, so it benefits everyone in the long run.

Strong disagree. Please do continue trying to educate the community, but that's no reason to take the guardrails off.

Re: Stop Using Git Ignore

#33

Earlier quoted context omitted.

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.

Thank you! I like to think of my articles and youtube videos as a starting point for discussion - even after 15+ years I am still learning

Re: Stop Using Git Ignore

#34
>I think most people are aware of the repo’s git ignore file

Not me, never heard of it.

I use ./.git/info/exclude to bypass commits and pushes, that is good enough for me.

Quickly reading the title, I though it was about stop using git period, go to something else :)

Re: Stop Using Git Ignore

#35

> As a maintainer, don’t fall into the trap of putting every possible exclusion into the repo’s git ignore. This really is a “sticky plaster” approach in my view. What we should try to do is up-skill and educate the community, so it benefits everyone in the long run. Strong disagree. Please do continue trying to educate the community, but that's no reason to take the guardrails off.

Thank you for reading and commenting. It is great to understand different people's perspectives.

From my experience the main downside of keeping the "guardrails on", people are less likely to learn about the importance of git global ignore and also with open source projects there can be a green square chasing game (which we also need to educate people on) - just thinking about this, more Pull Requests will come in with unwanted files though, which will be painful for contributors and maintainers, but could be a good lesson?

Re: Stop Using Git Ignore

#37
This is bad advice. The repo’s ignore file is there so that other people (without certain domain knowledge) don’t accidentally commit undesirable files, including directories containing sensitive information (which get generated by some tools like Terraform).

Use the repo’s ignore, not your own.

Re: Stop Using Git Ignore

#38
post #20

not sure I agree with the article or not, just wanted to state there's a third option: you can define your ignore rules per project but not necessarily share the, by putting the ignore rules in: .git/info/exclude

Oh interesting 3rd option! Thank you for sharing, I will explore the practically side to this option and feedback. Thank you!

Re: Stop Using Git Ignore

#39

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.

I utterly fucking despise that Git allows ignored files in some cases. FUCKING DESPISE.

IMHO the .gitignore should be the source of truth.

Re: Stop Using Git Ignore

#40

> As a maintainer, don’t fall into the trap of putting every possible exclusion into the repo’s git ignore. This really is a “sticky plaster” approach in my view. What we should try to do is up-skill and educate the community, so it benefits everyone in the long run. Strong disagree. Please do continue trying to educate the community, but that's no reason to take the guardrails off.

Thank you for reading and commenting. It is great to understand different people's perspectives. From my experience the main downside of keeping the "guardrails on", people are less likely to learn about the importance of git global ignore and also with open source projects there can be a green square chasing game (which we also need to educate people on) - just thinking about this, more Pull Requests will come in wi…

You've mentioned the "green square game" a lot, and I don't see how this is a problem. If someone makes a PR that is nothing but the .gitignore file, you can just reject it in one second. (Unless it is a well-researched and well-justified change, in which case you can gratefully merge it.)
Post reply on HN