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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

If "git switch" is not recognized as a git command, provide alternative instructions #82152

Open
4 tasks done
jennie-jd opened this issue Mar 12, 2024 · 4 comments
Open
4 tasks done

Comments

@jennie-jd
Copy link
Contributor

jennie-jd commented Mar 12, 2024

馃悶 Problem

My machine gave me an error that "git: 'switch' is not a git command. See 'git --help'".

馃幆 Goal

After reading the git help menu, I discovered that git branch + git checkout is an alternative way of creating a new branch and switching to it, so adding these instructions will help people like me.

馃挕 Possible solutions

Add additional instructions:

If the following does not work:
git switch -c your-new-branch-name

Consider using git branch and then git checkout:
git branch your-new-branch-name
git checkout your-new-branch-name

Or, a combined instruction:
git checkout -b your-new-branch-name

馃搵 Steps to solve the problem

  • Comment below about what you've started working on.
  • Add, commit, push your changes.
  • Submit a pull request and add this in comments - Addresses #<put issue number here>
  • Ask for reviews in comments section of pull request.
  • Celebrate your contribution to this project. 馃帀
@Esh07
Copy link
Contributor

Esh07 commented Mar 22, 2024

Here is good read
https://ioflood.com/blog/git-switch-vs-checkout-pros-and-cons/

Git Switch and Git Checkout are both used for switching between different branches in a repository. However, Git Checkout is a versatile command also capable of discarding changes and creating new branches, while Git Switch is a newer, more specialized command focused solely on switching and creating branches.

It sound like using old git version < 2.27.0.

Check git version
git --version

@jennie-jd
Copy link
Contributor Author

Here is good read https://ioflood.com/blog/git-switch-vs-checkout-pros-and-cons/

Git Switch and Git Checkout are both used for switching between different branches in a repository. However, Git Checkout is a versatile command also capable of discarding changes and creating new branches, while Git Switch is a newer, more specialized command focused solely on switching and creating branches.

It sound like using old git version < 2.27.0.

Check git version git --version

Thanks, very helpful materials. That being said, I submitted a PR with some added information about git checkout, but the repo owner does not seem to be active in reviewing the PRs, so I am still waiting for his review.

@Esh07
Copy link
Contributor

Esh07 commented Mar 24, 2024

Here is good read https://ioflood.com/blog/git-switch-vs-checkout-pros-and-cons/

Git Switch and Git Checkout are both used for switching between different branches in a repository. However, Git Checkout is a versatile command also capable of discarding changes and creating new branches, while Git Switch is a newer, more specialized command focused solely on switching and creating branches.

It sound like using old git version < 2.27.0.
Check git version git --version

Thanks, very helpful materials. That being said, I submitted a PR with some added information about git checkout, but the repo owner does not seem to be active in reviewing the PRs, so I am still waiting for his review.

There is only one maintainer so it may take while to be merged. Mine also pending there.

@Gokilp
Copy link

Gokilp commented Mar 29, 2024

check out your github version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants