Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 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

like image 305
gby Avatar asked Apr 21 '10 09:04

gby


People also ask

How do I make a GitHub repository private?

Under your repository name, click Settings. Under "Danger Zone", to the right of to "Change repository visibility", click Change visibility. Select a visibility. To verify that you're changing the correct repository's visibility, type the name of the repository you want to change the visibility of.

Can I have a private repository on GitHub?

When you create a repository, you can choose to make the repository public or private. Repositories in organizations that use GitHub Enterprise Cloud and are owned by an enterprise account can also be created with internal visibility.

Can I host a private repository?

It is only possible with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. I contacted GitHub support and they replied back confirming this. They stated "You can host a GitHub Pages site from a private repository, however all published sites are public."


2 Answers

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://[email protected]/" />

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.

like image 51
gby Avatar answered Sep 20 '22 16:09

gby


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

like image 22
Dan Denkijin Avatar answered Sep 19 '22 16:09

Dan Denkijin