Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Hacker News new | past | comments | ask | show | jobs | submit login

I knew about `git switch` but this is the first time I hear about `git restore`.

It also never occurred to me that the checkout command was overloaded in that particular way.




Doesn't seem overloaded, seems quite fitting. Checkout a hash or a file from a hash. Switch kinda seems "underloaded" in this way.


It's definitely unintuitive for newcomers.

And I think arguably modifying working-directory files vs. modifying .git/HEAD are distinct things (though at this point I also find using checkout for everything to be pretty intuitive).


Yea it never bothered me and I never understood why people kept complaining about it online. It seemed very superficial complaint.

The way you use git is by first understanding its model. If you understand the git model, everything makes sense.

If you come to it expecting it to be a tool that magically does what you want, I guess you will be very disappointed.


> Yea it never bothered me and I never understood why people kept complaining about it online. It seemed very superficial complaint.

Consistency may be superficial to you, but that's a personal preference that not everyone shares.

> The way you use git is by first understanding its model. If you understand the git model, everything makes sense

Doesn't follow. I think I've got at least an acceptable handle on git's model, but I can't see how that should mean I'd have to accept that wildly inconsistent command switches "make sense". Care to explain how one leads to the other?


I don't think magic is part of it. People like me just want it to be consistent.


switch being underloaded to checkout is the same as checkout being overloaded to switch.

In the checkout model, branches are just named aliases for their current hash. This seems trivial to me. Do we really need to use another vocabulary spot up in our heads for a command that is strictly a more-restricted checkout?




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: