There are two possible reasons that you are not seeing the branches on Bitbucket.
- Your question is a duplicate of Firedrill: Recreate central git repository from developers clones, as @ThorbjørnRavnAndersen points out.
- You have remote tracking branches in your repository that you are trying to push.
If it's the later, you should know that Git only pushes your local branches to the remote and not your remote tracking branches.
Your local branches are the ones that git prints when you run
git branch # show only local branches
Your remote tracking branches are the ones that git prints when you run
git branch -r # show only remote tracking branches
But what you were running was showing you both the local and remote tracking branches
git branch -a # show both local and remote tracking branches
To make a remote tracking branch a local branch you can run
git branch <local-branch-name> <remote-branch-name>
Or in your specific example
git branch branch1 remotes/branch1
However, I have a feeling that there's more to your repository than you mentioned because the remotes/branch1
is not really the correct convention for branch names... The reason I say that is that the remotes
keyword is special and used in refs/remotes/
which is the official prefix of all remote tracking branches.
Can you please provide us with the output of the git branch
and git branch -r
commands (appropriately redacted for a public forum), and let us know which branches you expect Git to push to Bitbucket?
Edit: From @DanielMoss's comment referring to the Atlassian SVN import process:
Branches and tags are not imported into the new Git repository as you
might expect. You won’t find any of your SVN branches in the git
branch output, nor will you find any of your SVN tags in the git tag
output. But, if you run git branch -r, you’ll find all of the branches
and tags from your SVN repository. The git svn clone command imports
your SVN branches as remote branches and imports your SVN tags as
remote branches prefixed with tags/.