4 ms·
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
by ilyagr 4y ago
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.
- marssaxman 4y agoWow! 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.
- dreamcompiler 4y agoFunny. 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?
- brianzelip 4y agoOne example, when reverting file changes to previous file state from last commit, the following are equivalent: `git checkout — $FILE` and `git restore $FILE`.
- computerfriend 4y agoWow, time to get rid of my `git reset-file` alias.