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

I, personally, learned to use git a couple of years ago, have never learned to use the `checkout` command, and had no need for it. The goal of `switch`/`restore` is to do everything that `checkout` does while being less of a confusing mess.

See also the reddit thread linked by a nephew comment.



Funny. I know 'checkout' pretty well but I've never seen 'switch'/'restore' before today.

Switch seems straightforward but I don't understand restore. Is it possible to describe restore in terms of checkout?


One example, when reverting file changes to previous file state from last commit, the following are equivalent: `git checkout — $FILE` and `git restore $FILE`.


Wow, time to get rid of my `git reset-file` alias.


Wow! That's a really hopeful thing to hear. I have been bemoaning git's bafflingly inconsistent interface for years, and checkout is one of the worst. Glad to hear we can finally move on.




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

Search: