On May 6, 9:49 am, Srinidhi K V <srinidh...@yahoo.co.in> wrote:
> Hi All,
> I have a GIT repository in which there are lot of remote branches, I
> have created a bare git repository in my server. When I push my local
> repository to the bare repository in server using "git push --all"
> only local branches get pushed.
> However when I use "git branch -r" I get remote branches which tracks
> to local branch.
> I need push all the existing remote branches from my local repo to
> bare repository in my server. How do i do that? Any pointer would be
> of great help.

>From what you described, Git probably is doing the right thing. When
you say your existing repository has lot of remote branches, I suppose
you either copied your repository from someone, or you added those
remotes yourself. I don't think you got all of them (except your
'origin') when you cloned it, did you?

Technically, remote branches don't belong to your repository. They are
just references that you use to point to a branch in some one else's
repository. Also, when you say you've some remote branches, you
probably are already tracking them with your local branches; so they
get pushed to your server anyway.

Someone pulling from your repository (to which you just pushed) would
see local branches that you decided to push. However, what _other_
remote branches they'd like to add and track is only up to them. In
other words, IIUC, you can only push local branches. If you want to
push the remote branches, the right thing to do is to create local
branches and push them.

git branch -t other_remote/remote_branch my_tracked_branch
git push origin my_tracked_branch

In any case, if you see the documentation for 'push --all', it says:

           Instead of naming each ref to push, specifies that all refs
under refs/heads/ be pushed.

Your remotes don't reside under refs/heads/, but under refs/remotes/.
What lies under refs/head are your local branches.



You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to