←back to thread

Oh Shit, Git?

(ohshitgit.com)
464 points Anon84 | 1 comments | | HN request time: 0s | source
Show context
tantalor ◴[] No.42730193[source]
I'm not a git user, but stuff like this really drives home the idea that "git commit" is meaningless, the only thing that matters is when your commits are pushed or merged.

It's like saving a textfile. Do you write a little message every time you save a file? No that's silly. Just move on.

replies(6): >>42730255 #>>42730939 #>>42731265 #>>42731513 #>>42732537 #>>42733777 #
Vampiero ◴[] No.42732537[source]
It seems painfully obvious to me that local and remote commits serve different purposes. Local commits are a way to create checkpoints when everything compiles and works and you can move on to the next step. That way you can stash your changes and go back to a working state when you screw things up. Then, before you push those changes, you reset them and split them into proper commits. That way the history is all nice and clean on the remote and it's not just a bunch of "wip"s.

Or you can just squash-merge your PRs and reap both benefits.

replies(3): >>42732653 #>>42733838 #>>42743773 #
1. MetaWhirledPeas ◴[] No.42733838[source]
I think people would generally have an easier time with git if they didn't try to fix their commit histories and instead just let their past mistakes be known. If you make a bad commit in git the best solution is to follow it up with a good one that fixes the problem. Squash commits on PRs help too.