For some reason I can’t checkout local branch in IntelliJ IDEA (123.150) git plugin. I suspect I simply don’t understand how it’s supposed to work.
I thought that I have local branch if I cloned repo on my disk.
Here is what I did
- Created new project via “Check out from Version Control”.
- IDEA shows I’m in git’s master branch.
- If I click in right bottom corner on “Git: master” label it shows list of remote branches and no local branches
- If I click on remote
origin/masterand selectCheckout as new local branchit gives me error sayingBranch name master alreadyexists.
I’m confused. Why it doesn’t show any local branches ? If I don’t have any why it doesn’t let me create new one locally with name master ?
checkoutis used for switching between branches or creating new ones in your repository. If you want to get the code from another repository, you need to use thepullorfetchcommands. I don’t know where these are in the IntelliJ plugin. I am simply using the names used at the command-line. Hopefully they will help you find what you need.