question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Git switch vs git checkout

See original GitHub issue

🆕 Moving from git checkout to git switch

Is your feature request related to a problem? Please describe. On Git 2.23 git switch was introduce as a specific command to change from one branch to another. The idea behind this change is that git checkout makes more than only changing branches (like restoring the working tree files).

The new ‘experimental’ git switch branch command is meant to provide a better interface by having a clear separation, which helps to alleviate the developers’ confusion when using git checkout. One such example is git checkout <filename> which reverses the modifications of an unstaged file and git checkout <branchname> which switches branch. The dilemma is more when the filename and branch name are the same.

The new commands, git restore (takes care of operations that change file), and the git switch (takes care of operations that change branches) share out the responsibilities of git checkout in a more intuitive way.

Describe the solution you’d like Since Git is looking forward to moving from git checkout to git switch in the near future, I would consider changing Module 2.

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:13
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
jloopercommented, Apr 1, 2021

Thanks, we will keep an eye out for the change

3reactions
costaDZcommented, May 27, 2021

Thanks for this info .

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's the difference between git switch and git checkout ...
switch is created for the single purpose of changing branches, and when you do that, you do want to be at the HEAD...
Read more >
What's the Difference Between Git Switch and Checkout?
Here's the thing. Git checkout is the old command which was used to create and switch branches. It can also be used to...
Read more >
git switch branch vs checkout - Bluecast Technologies
git switch branch command is the new command for changing branches instead of the old fashioned 'git checkout branch'.
Read more >
What is the Difference Between git switch and checkout
The git checkout command creates, and switches branches, restores and undo changes from commit; however, git switch only creates and switches branches.
Read more >
Using git switch (Is it alternate to git checkout?) - GoLinuxCloud
Git switch and git checkout let you create and move into a branch. The main difference between the two git commands is that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found