Answer the question
In order to leave comments, you need to log in
Why did you switch to a non-existent branch?
On the remote server there are 3 branches master , branch1 , branch2 when cloning with git clone I want to see which branches are available to me and I write git branch , it only shows me the master branch . But when I switch to branch1 with git checkout branch1 , the switch succeeds.
Why did I switch to the branch1 branch if this branch does not exist. because git branch didn't show it?
Answer the question
In order to leave comments, you need to log in
git branch with no options shows only local branches
git branch -r shows only branches of the remote repository
git branch -a shows all
If you switch to a branch that does not exist locally, but exists in the remote repository, it is automatically pulled from the server
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question