logoalt Hacker News

gruezyesterday at 2:51 PM7 repliesview on HN

>This seems like bad advice. I've very rarely committed extra files by accident, [...]

You clearly haven't seen the people who are lazy and so just do `git add . && git commit -m ... && git push -f origin` every time.


Replies

rcfoxyesterday at 2:54 PM

I'm not convinced people acting on muscle memory would remember to unignore the files either. They're going to lose work or have giant "oops, I forgot to commit these files" commits.

ozimyesterday at 6:38 PM

I do that for my personal projects.

Doing that on projects where I collaborate I would equate to pissing in public.

That is also why pull requests are such a great idea in general, because GIT allows one to piss in his own garden as much as they want.

Even if I could piss in my own branch I never do so when working on a project with other people.

I don't piss around my home obviously in case someone didn't get the metaphor.

cushyesterday at 2:57 PM

Now walk through exactly what would happen when those lazy people follow this approach…

You see the issue right?

show 1 reply
JimDabellyesterday at 5:35 PM

> You clearly haven't seen the people who are lazy and so just do `git add . && git commit -m ... && git push -f origin` every time.

I’ve worked with and managed plenty of people like that and those are the people I least want doing something like this. Seeing the flotsam and jetsam of .DS_Store etc. are an early warning sign they aren’t paying any attention to what they push and the sooner that gets caught and addressed the better.

jeremyjhyesterday at 6:05 PM

So the better alternative is for them to leave out files that should be committed?

godelskiyesterday at 6:09 PM

  > people who are lazy and so just do `git add . && git commit -m ... && git push -f origin` every time.
People? Even LLMs do that
show 2 replies
efilifeyesterday at 6:00 PM

I do this. What's wrong with this approach and how should it be done correctly?

show 1 reply