Ad
Git (CLI) Won't Let Me Switch Branches
I have two branches in the local repository:
tool[email protected]:~/src/dev/auth-monitoring$ git branch
dev-mar-21
* master
as you see I am on master (I swapped back to check something).
when I try to switch back to the dev branch I get:
[email protected]:~/src/dev/auth-monitoring$ git checkout -b dev-mar-21
fatal: A branch named 'dev-mar-21' already exists.
As usual I am clearly missing something!
Ad
Answer
The -b
option is a request to first create a new branch before switching to it. You want to switch to an existing branch, so -b
is not needed.
git checkout dev-mar-21
Ad
source: stackoverflow.com
Related Questions
- → Authenticate with a cookie using laravel 5.1 and jwt
- → Finding a specific GitLab tag from PHP
- → React: How to publish page on server using React-starter-kit
- → babel-loader, webpack, ES2015 modules: "Element type is invalid"
- → Create a function-attribute of a function, which is, in its turn, a method of an object literal
- → Model Validation in laravel 5.1 not working
- → GIT fatal: loose object
- → Laravel validation required rule not working
- → Axios array map callback
- → Where does this `webpack://` come from for `webpack-dev-middleware`?
- → error when trying to modify project in laravel forge
- → GitHub Pages and Jekyll content duplication and SEO issues
- → Use Laravel repositories with Datatables
Ad