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:
- Created 2 years ago
- Reactions:13
- Comments:10 (3 by maintainers)
Top GitHub Comments
Thanks, we will keep an eye out for the change
Thanks for this info .