On Mon, 30 Nov 2015 23:15:32 +0530
rajdeep mondal <justrajd...@gmail.com> wrote:

> 1. i have repos:
>       A with branches A1, A2, A3
>       B with branches B1, B2, B3 etc
> 2. i want to push these 2 independent repo to a central repo MY_REPO
>     as branch A and branch B
> 3. The A1, A2, A3 are subbranches of branch A
> 4. B1, B2. B3 are subbranches of the branch B

OK, that's clearer now.

The problem is that branches in Git do not form any sort of hierarchy
-- except for being related through the parts of history they may share.

Well, may be you just meant naming?
Like in `push origin A1 A/A1 B1 B/B1` ?
If yes, then:

1) In repo A, do:

   git push central 'refs/heads/*:refs/heads/A/*'

2) In repo B, do:

   git push central 'refs/heads/*:refs/heads/B/*'

Note that it won't push other sorts of refs (tags, notes, whatever else
you might have).  Pushing those would require a similar approach.

If that's what you really wanted, it worth repeating that when you push
A1 to A/A1, the remote A1 is not "a subbranch of A", it's a branch
named "A/A1".  If you'd push to A\A1 or A%A1 or any other similar
"strange" name, the result would be the same: a branch with a funky
name.  IOW, the fact some parts of Git use "/" for some sort of
"namespacing" of refs is just a convention.  People are free to use it,
too, just keep in mind this thing is simpler than it appears.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to