Skip to content

Git switch vs git checkout #251

Closed
@juanpflores

Description

@juanpflores

🆕 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions