4 ms·
> I see no harm in having history. You want meaningful history, not unfiltered history. The harm is that the history is no longer as useful if it's not curate
by jonahx 4y ago
> I see no harm in having history.
You want meaningful history, not unfiltered history.
The harm is that the history is no longer as useful if it's not curated -- whether that's for tracking down the origin of a bug, or just using it to remember what you did a few weeks ago.
It's easy to see the flaw in "keep everything" by taking the argument to its logical conclusion, which would be recording the history of every keystroke in your editor.
If you have false starts or alternate approaches that you gave up on but think you might still want, by all means save them, just not in "main."
- quickthrower2 4y agoYou could use branches / tags for this purpose. Reverts are not too bad becuase they are pretty meaningful. If your commits are meaningful then the revert is "reverts: {meaniningful commit message}"
- jonahx 4y ago> You could use branches / tags for this purpose. Yeah that's what I meant by save them. > Reverts are not too bad becuase they are pretty meaningful. I was responding to: "I still revert rather than reset and don't force push". Say you are working privately on a branch, saving your work, etc. You realize you made a silly error, and need to undo a commit. Creating a revert commit here is a pretty serious error of git organization imo. Typically you do not want to save this work... it is just your private mess as you were working through the problem, and when you are done and have solved it, you want to save the final result, as clean history, perhaps as multiple commits, perhaps as one. After you have published your work publicly, then yes, you need to do a revert commit if you made a mistake.
- quickthrower2 4y agoYou are right. There a times when, if I have a local-only branch and there is no utility in keeping the error I will reset. It is rare but it happens. If I went down a direction then tried something else, I prefer revert so I don't lose that. That said, tagging then resetting is probably just as good and might have the best of both worlds. You get to keep what you did and you keep the history clean. I only just thought of this now! Tagging and resetting is of course a bit like stash, but I see stashes as very temporary. It is easy to lost them due to stash pop.
- Jare 4y ago> by taking the argument to its logical conclusion I don't see how that's logical in any way.