←back to thread

1062 points mixto | 2 comments | | HN request time: 0.698s | source
Show context
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 #
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 #
1. RohMin ◴[] No.42949680[source]
git switch focuses on switching branches while git checkout extends further than that
replies(1): >>42950963 #
2. diggan ◴[] No.42950963[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.