How do I get IntelliJ to see my remote git branches

GitIntellij Idea

Git Problem Overview


I'm using BitBucket and I created a branch on another machine with IntelliJ and pushed it in to my repo. I can see the branch on the BitBucket site, but when I try to access the remote branch using IntelliJ on another machine I can't see the new branch when I go to VCS -> git -> Remote Branches. I tried doing a pull, but that only brought down the head changes (which currently points to master), and didn't update the remote branches list. Is there something you have to do to see the remote branches (besides Head and Master) in IntelliJ?

Git Solutions


Solution 1 - Git

In case anyone runs in to something similar I found that on my IntelliJ at least I had to run a fetch and then I could see the remote branches. It didn't appear that a pull was sufficient even though pull is supposed to fetch.

Solution 2 - Git

I found the same thing with IntelliJ, also fetch not only gets all remote branches for the current repository in your project, but it also gets them for all repositories in the project.

It is safe to say that a pull only fetches for the current repository and branch that you are on, and fetch fetches for all repositories in the project.

(I would have simply commented on Zipper's excellent answer, but I seem to only have one reputation point :-()

Solution 3 - Git

I was in the same case, my repo is in Bitbucket, I created a branch from another machine but in my main machine I was unable to see it. I tried several times VCS->Git->Fetch without success. I even restart IntelliJ but same result. To solve my issue, I created the branch manually and use:

git branch --set-upstream-to=origin/my-branch my-branch

Solution 4 - Git

In case anyone came here for this issue in PyCharm (by same creators), I added new branches after I had already cloned the repo into PyCharm. Fetch, from either the command line or within the GUI, would not pickup the new branches even after I tried several times and restarted the program.

I ended up deleting the repo, re-cloning, and was then able to find and checkout the branches I needed.

Solution 5 - Git

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionZipperView Question on Stackoverflow
Solution 1 - GitZipperView Answer on Stackoverflow
Solution 2 - GitLowellView Answer on Stackoverflow
Solution 3 - Gitakuma8View Answer on Stackoverflow
Solution 4 - GitSummerElaView Answer on Stackoverflow
Solution 5 - GitBrianCView Answer on Stackoverflow