If you download the repository with git clone <repo_url> -b <branch>
(only cloning certaing branch), you should modify the <repo_name>/.git/config
file.
Replace or modify the line that references the fetch target of the [remote "origin"]
section to let the command git fetch --all
discover all branches:
[remote "origin"]
url = <repo_git_url>
fetch = +refs/heads/master:refs/remotes/origin/master
Be sure to set the fetch parameter point to /heads/master
.
Care with git fetch --all
because this will fetch all, so may take a long time.