Hacker News new | ask | show | jobs
by magnifyhim 1085 days ago
I struggle the most with Git when I'm working on something exploratory. If I've done it before, it's easy to make commits independent and include their own tests. If I'm figuring it out as I go, I'm more likely to have commit messages like "wip", "build X; refactor Y."

I'm experimenting with this workflow: lean into the Git messiness, git reset --hard all my "bad" commits, and then re-write history to make the "clean" commits that follow principles like these.

1 comments

This is why interactive rebase exists. With a good porcelain like Magit it’s quite easy to take an ugly exploratory chain of “try this,” “try that,” “WIP,” “WIP,” etc commits and mash it into one or more sensible commits that are suitable for bisecting and have good commit messages.