|
|
|
|
|
by gknoy
3494 days ago
|
|
Recovering from a lisp image is pretty darned cool. :D > I had a lot of unchecked work - about a weeks worth
> ... It is the second time I have lost work by misusing git I realize this is _off topic_, but one thing that helps me a lot is making regular small commits (that describe some small idea of the change), and then rebase them later once I get all the linting / tests fixed. (Obviously not on master ;)) It's easy to go too-granular here, but it's very handy to be able to reorder the commits, or squash "fixup" commits, to make things easier to review. I spend more time rebasing than I probably need to, but on the other hand I've never lost work. ;) For example (adapted from a PR I was working on this morning ;)) git commit -m "Add Clone Foo feature"
git commit -m "Reorganize tests"
git commit -m "Fix indentation"
git commit -m "Add generator for Baz items"
git commit -m "Add test of Clone Foo feature"
git commit -m "fixup linting in application"
git commit -m "fixup test linting"
git commit -m "fix Foo test to use correct selector"
git rebase --interactive master
# reorder fixup commits, squash them together with the things they fix
You can always rebase and squish all of these down into one commit later before you make your pull request (or, leave them as-is if your team is OK with un-squished PRs). |
|
The --autosquash option of git rebase can save you some work: