开发者

How to set up an Android source repo while hosting the git trees as private repositories on github?

I am trying to set up a private repository of Android source code while hosting the git trees on github as private repos.

I have no problem changing the manifest.xml file to point to public git trees hosted on github in the same way that CynagonMod开发者_StackOverflow中文版 does, but when trying to point to private repos I get the following error when trying "repo sync":

Initializing project username/android_external_webkit ...

fatal: The remote end hung up unexpectedly

error: Cannot fetch username/android_external_webkit

Where username/android_external_webkit is of course a private github repo of the same name.

I understand the error occurs since I did not specify my user name and credentials to github, but I fail to see how to do it in the manifest.xml with repo.

Any ideas?

Thanks! Gilad


Well, feeling silly to answer my own question but I found out the answer so maybe I will save a few minutes to the next person that runs into it.

The answer is very simply: in the manifest.xml file, create a remote tag with the fetch specifying ssh as the transport and "git" as the username. Here is an example:

<remote name="private_stuff" fetch="ssh://git@github.com/" />

Now use "private_stuff" as the remote field of the git trees you want to pull. For example:

<project path="xyz" name="username/xyz" remote="private_tuff" />

And init and sync the repo as usual.


It seems the proper method is to use a local_manifest.xml in the ./repo directory as per this link

see also the official repo documentation


just add this to your manifest

<remote name="github" fetch="https://github.com/" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜