I have GitHub repository with multiple branches, and I want to commit and push changes to a specific branch, how can I switch from "master*" branch to another branch?
I tried to switch by clicking the branch name in the left bottom side of the screen and it didn't switch.
CodePudding user response:
- Access the "Source Control" tab on the left side of VSCode
- Click on the "three small dots" next to the refresh button
- Click on the "Checkout to..." option
- Choose the branch you want to switch to
You can also try this:
you do git branch branch_name
then git checkout branch_name
CodePudding user response:
// it will create new branch and switch to that branch
git checkout -b branch-name
// it will directly switch to previously created branch
git checkout branch-name