Comment by gen220

4 years ago

Have you considered using `git commit --amend --no-edit` after making your first commit? It simplifies the unwinding step.

This is pretty much my workflow, too. I’ll make some changes, `git commit -m wip`, and then `g can`. When you’re ready to prepare the PR/diff, `reset HEAD^`. Then, a few cycles of `add -p`, `commit -v`.

`commit --amend` and `add --patch` are super powers!

If you do this, and find you want to go back to 3-4 commits ago, you need to dig around in the reflog for it.

  • Ah yeah, that's a totally fair critique. Everything in moderation, I suppose. :)

    I must avoid those situations by making a new commit when I anticipate wanting to keep the reference to that point in work accessible.

    I do dive into `reflog` maybe once or twice a quarter, but as far as I can remember, I only go there as an immediate reaction to tired-brain mistakes.