3 ms·
> It just always leaves that old sour taste of "it should be easier than that". git branch branch-i-should-have-made git reset --hard origin/master Ho
by dlsspy 17y ago
> It just always leaves that old sour taste of "it should be easier than that".
git branch branch-i-should-have-made
git reset --hard origin/master
How would you make it easier? Why is that kludgy?
> So, do you know that stuff from the top of your head? Or how much man-page wrestling did you have to do before the safety net actually caught you?
Uh, no. I type "git reflog" and look for the thing I want. Then I copy the hash and do whatever I was going to do with it -- the same thing I do in hg went I look at its logs and want to reference something older.
You are contriving a complex use case of a rarely used safety-net command, when in reality, it's just not that hard to use. I was listening to an SE at work introducing another guy to it earlier today when the guy needed to recover from a mistake he made.
- moe 17y agoHow would you make it easier? Why is that kludgy? That is not the kludgy part. The kludgy part begins when you have created a few branches that way and start bringing in changes from upstream, or when the branches begin to conflict with each other. Suddenly there is housekeeping involved, merging stuff back and forward. I just don't understand why git lets me comfortably stage individual hunks (a feature that I love and use extensively) but refuses to deal with uncommitted changes as intelligently as with everything else. I don't want to commit the three spurious lines I just typed into the editor before going to the bathroom. Yet I'd like to do a quick pull from my co-worker when I come back, before continuing on those lines and without commiting my 3 lines first. This is rather contrived again, but it shows the underlying problem of git not staying out of the way as it should but instead forcing me to do something completely unrelated to my actual goal - a sure sign of a bad UI. You are contriving a complex use case of a rarely used safety-net command Well, I agree it was rather contrived. Yet I still wonder how many git users, when asked, could quickly type out the command to undo their last rebase and how many know, without looking, how to weasel out of the various follow-up errors that may appear ("Interactive rebase already started" anyone?).