←back to thread

1062 points mixto | 7 comments | | HN request time: 1.782s | source | bottom
1. Sxubas ◴[] No.42943267[source]
> The Old Command: git checkout

I didn't even know git switch existed, let alone git checkout was considered the old alternative. I feel old.

To be fair I started learning git a little less than 10 years ago but woah, I can't express how it feels that someone learning git today will be confused of why I use git checkout. Like using old fashioned language.

More on topic, this guide would've been super useful when I was learning. It is really easy to follow and covers common FAQs.

I fondly remember being intimidated by my first merge conflict, aborting it and just doing some workarounds to prevent the conflict.

replies(2): >>42943409 #>>42948624 #
2. Rendello ◴[] No.42943409[source]
Git switch is fairly new, it first shipped in 2019.

Here's, respectively, a discussion from 2021, and a discussion from a few weeks ago. In the latter, it's brought up that `git switch` is still considered experimental by the docs:

https://news.ycombinator.com/item?id=28024972

https://news.ycombinator.com/item?id=42649858

3. diggan ◴[] No.42948624[source]
> I didn't even know git switch existed, let alone git checkout was considered the old alternative. I feel old.

I don't think "git checkout" is considered the "old alternative", at least not yet. Last time I checked, `switch` is still experimental, I haven't even considered moving away from the workflows/commands I first learned when I picked up Git ~15 years ago. Everything I want to do still works exactly the same (`git checkout` still does the exact same stuff as before), and I'm able to collaborate with everyone else using git, why change workflow then?

replies(2): >>42949680 #>>42954872 #
4. RohMin ◴[] No.42949680[source]
git switch focuses on switching branches while git checkout extends further than that
replies(1): >>42950963 #
5. diggan ◴[] No.42950963{3}[source]
Right, so for the folks at home who already know and use `git checkout`, no switch needed (no pun intended) as everything already works fine and probably won't be deprecated in the near future.
6. juped ◴[] No.42954872[source]
switch/restore are not experimental in that sense, they're experimental in the sense that they're not guaranteed stable so don't rely on them for scripts or something (I occasionally tell myself I should adopt them and get them stabilized, but then don't do it)
replies(1): >>42964060 #
7. bicolao ◴[] No.42964060{3}[source]
It was experimental to allow the developers to tweak UI, including breaking backward compatibility if needed. But I left Git shortly after these were added. I guess nobody picked this up to finish the job (even by just removing the experimental status, since nothing has changed for years and I assume nobody complained about them).