3 ms·
Why in the world would you say that? I check out a branch, I write some code, it doesn't do what I want, I do a git reset and try again. If you aren't using g
by jedberg 7y ago
Why in the world would you say that? I check out a branch, I write some code, it doesn't do what I want, I do a git reset and try again.
If you aren't using git reset that means you're either a genius coder who doesn't make mistakes, or you are a coder who would rather keep going down a bad path instead of just starting fresh. Some people find it easier to just start fresh.
- claytonjy 7y agoFor me, it's never the case that new code I'm writing is SO devoid of value I'd rather pretend I never wrote it, but that's what a reset does. Rather, I keep iterating until I've made clear progress, then commit.
- kyberias 7y agoBecause git reset --hard is kinda dangerous, I've resorted to managing my changes with other safer commands. I undo changes with git checkout. Sometimes I stash and forget. I only use git reset --hard when I have accidentally committed something to an incorrect branch and I want to reset that branch to point to a specific commit after creating another branch. I strive for perfection in other areas of my like as well. :)