Why does an 'm' get added to the remote branch name

2,835 views
Skip to first unread message

Elvis Dowson

unread,
Feb 24, 2011, 10:32:19 AM2/24/11
to Repo and Gerrit Discussion
Hi,
When I do a

$ repo init -u git://android.git.kernel.org/platform/manifest.git -b
android-2.2.1_r1
$ repo sync
$ repo start myandroid-2.2.1_r1 -all
$ cd build
$ git branch -a

I get a whole bunch of standard remotes, but there is an 'm' in the
middle of the one that I branched from (toward the end of the list):

myandroid-2.2.1_r1

<snip>

remotes/m/android-2.2.1_r1 -> refs/tags/android-2.2.1_r1

The above is what happens when I clone off the main android repo.

What I'm really interested in is to set things up so that I can track
a remote branch, on a mirror repository, the equivalent of typing

$ repo forall -c git checkout -b myandroid-2.2.1_r1 --track /remote/
hercules/android-2.2.1_r1

I'm confused as to why there is an m in the middle of the remote name.

Elvis Dowson

Magnus Bäck

unread,
Feb 25, 2011, 1:39:46 AM2/25/11
to Repo and Gerrit Discussion
On Thursday, February 24, 2011 at 16:32 CET,
Elvis Dowson <elvis....@gmail.com> wrote:

> When I do a
>
> $ repo init -u git://android.git.kernel.org/platform/manifest.git -b
> android-2.2.1_r1
> $ repo sync
> $ repo start myandroid-2.2.1_r1 -all
> $ cd build
> $ git branch -a
>
> I get a whole bunch of standard remotes, but there is an 'm' in the
> middle of the one that I branched from (toward the end of the list):
>
> myandroid-2.2.1_r1
>
> <snip>
>
> remotes/m/android-2.2.1_r1 -> refs/tags/android-2.2.1_r1
>
> The above is what happens when I clone off the main android repo.

The m/foo ref is a symlink to whatever the foo manifest points at for
the git in question. In other words, if you sync from the manifest
branch foo you will get a ref in each git named m/foo that points to
whatever the revision element in the manifest says. This can be quite
useful if you don't use the same revision in all gits.

> What I'm really interested in is to set things up so that I can track
> a remote branch, on a mirror repository, the equivalent of typing
>
> $ repo forall -c git checkout -b myandroid-2.2.1_r1 --track /remote/
> hercules/android-2.2.1_r1
>
> I'm confused as to why there is an m in the middle of the remote name.

The "repo start" you've already done should accomplish what you want.

--
Magnus B�ck Opinions are my own and do not necessarily
SW Configuration Manager represent the ones of my employer, etc.
Sony Ericsson

Reply all
Reply to author
Forward
0 new messages