Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git switch vs git checkout #251

Closed
juanpflores opened this issue Apr 1, 2021 · 10 comments · Fixed by #630
Closed

Git switch vs git checkout #251

juanpflores opened this issue Apr 1, 2021 · 10 comments · Fixed by #630

Comments

@juanpflores
Copy link

🆕 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 which reverses the modifications of an unstaged file and git checkout 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

@jlooper
Copy link
Contributor

jlooper commented Apr 1, 2021

Thanks, we will keep an eye out for the change

@Nadjem-47
Copy link

Thanks for this info .

@Fronizzle
Copy link

🆕 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 which reverses the modifications of an unstaged file and git checkout 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

#251 (comment)

@Fronizzle
Copy link

Git switch

@microsoft microsoft deleted a comment from eazydripz Jun 24, 2021
@djibal
Copy link

djibal commented Jun 24, 2021

git switch -m "switch-branch in checkout.git"

@djibal djibal mentioned this issue Jun 24, 2021
@iamsuryakant
Copy link
Contributor

Thanks for this info.

@jlooper
Copy link
Contributor

jlooper commented Jun 27, 2021

Please feel free to make a PR, updating all translations, thanks!

@Rodrigostrong
Copy link

Muito bom

@microsoft microsoft deleted a comment from Guntherbs268 Aug 3, 2021
@microsoft microsoft deleted a comment from Guntherbs268 Nov 7, 2021
@microsoft microsoft deleted a comment from Guntherbs268 Nov 7, 2021
@rishitxyz
Copy link

Please feel free to make a PR, updating all translations, thanks!

Can I take this up?

@github-actions
Copy link

github-actions bot commented Mar 9, 2022

This issue has not seen any action for a while! Closing for now, but it can be reopened at a later date.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants