Reputation: 3587
Recently I started development in IntelliJ with Git. I am trying to check out one specific remote branch only. But while checking out source code, IntelliJ never asked for which branch you want to check out. And by default, it checked out master branch only. Once the master branch is checked out then I can switch to my specific branch.
I searched IntelliJ documentation about how to check out specific branch or give the intial branch name to check out like eclipse but not able to locate it.
So can someone please help me about how to check out specific branch only using IntelliJ?
Thanks in advance.
Upvotes: 4
Views: 7810
Reputation: 1585
What I need is IntelliJ showing me the very first git clone command it executes when doing File > New > Project from Version Control ... The answers provided here are fine but this way you can only see subsequent git commands executed by IntelliJ not very first one to checkout the repo for the first time.
Reason I'm asking this is because checking out the GitLab repo from IntelliJ works on my development machine, but issuing git clone from the command prompt doesn't (something with certificateds I guess). So I would like to see what IntelliJ is doing to clone the repo.
Upvotes: 0
Reputation: 35
You should find a "git" tabon the bottom left of your IDE. There, you can find the different branches. if you right click on the branch you want to check out a pop-up menu appears with a "checkout" option" displayed
Upvotes: 2
Reputation: 16100
You can do this on the command line, but IntelliJ can't help with this. On the command line you want to use this template:
git clone <url> --branch <branch> --single-branch <folder>
Replacing url, branch, and folder, as appropriate
Upvotes: 2