After I clone from a bare git repository, my imported local repository doesn't have all the branches in it. Following is the architecture.
Here are the steps how this bare repository came into being.
- I had an existing repository (a in the figure). I did some branch filtering within this branch to rule out some useless directories.
- Created a new empty bare repository (b in the figure) using
git init --bare new_repo.git
- In the a local repository, I changed the remote URL using
git remote set-url origin /path/new_repo.git
. - Pushed the content of a to b using the command
git push origin '*:*'
and got success. - At this stage running the command
git branch -r
shows all the remote branches correctly. - Now when I clone b (bare repository), the cloned local repository (c in the figure) gets created and it has the correct directory structure. But the problem is that when I try to list all the remote branches using
git branch -r
, it lists only the master branch.
Why doesn't the cloned repository have all the remote branches and how can I have all those imported?