4 ms·
Since branches and such are cheap, you might benefit from `git switch -c debug`, `git reset` etc. They can wipe your working tree clean instead of having to do
by diarrhea 4y ago
Since branches and such are cheap, you might benefit from `git switch -c debug`, `git reset` etc. They can wipe your working tree clean instead of having to do it manually.
- WalterBright 4y agoI didn't know about that switch! thanks
- gugagore 4y agoThere are some cases where the smallest unit that the -p(atch) flag considers is not granular enough. In those cases, you can resort to manual editing. Even with that, I find it to be a huge timesaver.
- diarrhea 4y agoI suspect you already implicitly included it, but just to mention it: the hunks created by `--patch` commands can be split up further through `s`. But as you said, this is sometimes not enough either (two changed, adjacent lines will remain atomic).
- rhizome31 4y agoI don't know, in practice you'll also have useful changes that you want to keep. I usually resort to `git checkout -p` to get rid of the debugging statements.