Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



For 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.


Because 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. :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: