2

I'm trying to mirror every android repo to my gitlab account. After I imported ALL of repositories, I tried to use git-repo (repo tool from google) to build android from source.

I changed these line in my default.xml manifest:

<remote  name="aosp" fetch="https://android.googlesource.com" review="android-review.googlesource.com" revision="refs/tags/android-5.1.1_r37" />

to this:

<remote name="aosp" fetch="https://gitlab.com/android_source/" review="android-review.googlesource.com" revision="refs/tags/android-5.1.1_r37"/>

I also changed every project name. for example:

<project path="dalvik" name="platform/dalvik" groups="pdk-cw-fs" remote="aosp"/>

to this:

<project path="dalvik" name="platform_dalvik" groups="pdk-cw-fs" remote="aosp"/>

now, here is my problem. when I run repo command

repo sync

I get these type of errors:

Fetching projects:   0% (1/541)  Fetching project platform_prebuilts_ndk.git
fatal: Couldn't find remote ref refs/tags/android-5.1.1_r37
fatal: Couldn't find remote ref refs/tags/android-5.1.1_r37
error: Cannot fetch platform_prebuilts_ndk.git

error: Exited sync due to fetch errors

Whats wrong??

you can see default.xml and changed one.

EDIT: I found a solution but I don't like it. I changed this:

<remote name="aosp" fetch="https://gitlab.com/android_source/" review="android-review.googlesource.com" revision="refs/tags/android-5.1.1_r37"/>

to this:

<remote name="aosp" fetch="ssh://git@gitlab.com/android_source/" review="android-review.googlesource.com" revision="refs/tags/android-5.1.1_r37"/>

now I can fetch using git_repo tools. But this is odd. other people should be able to clone my repo.

3 Answers3

0

Not sure if that's what you need, but here it goes.


If you want to mirror your repo, you should:

  1. Click on Create New Project

  2. Import it and mirror:

Mirror repo on GitLab

This way GitLab will update the mirrored repo with the upstream automatically.

Hope to have helped!

Virtua Creative
  • 2,025
  • 1
  • 13
  • 18
0

If you can clone via ssh and not via https is probably because you configure GitLab projects as private and not public

I try to browse you personal gitlab group and, in fact, I cannot browse any project (however maybe it's just because you delete them, the question is, in fact, quite old, but maybe my answer may be useful to other too)

amonthedeamon
  • 306
  • 3
  • 9
0

First, I have to say that cloning all android-related projects is more a research idea than something useful for anyone else. It might be nice to understand the context a bit better.

Unfortunately, I cannot see the linked manifests as https://gitlab.com/android_source/tmp does not exist anymore (amonthedeamon mentioned this in a previous answer).

By default, the repo command uses a specific URL and path to retrieve the manifest. In order to use your manifest, you need to provide it in the repo init (ref) command.

  1. Add your manifest to a repository - it seems, you have done this.
  2. Use the -u and optional -m and -b arguments to point to the manifest

In your case, this would be

repo init -u https://gitlab.com/android_source/tmp.git
repo sync 

Then, repo sync will go through the projects run git clone with the remote URL. I assume you are there, but I am not sure.

Assuming that you have cloned all repositories into android_source, they should now be available via your git prefix https://gitlab.com/android_source/. Git will now try to clone from https://gitlab.com/android_source/{projectname}, which does not seem to work.

If ssh://git@gitlab.com... works and https://gitlab.com... does not, I assume, a normal git clone does not work for the https URL. With a current version of git, you should be prompted for username and password. With credentials, you should be able to store that information

There are a couple of suggestions

  • Switch to a more recent version of git that supports https authentication
  • Make your projects public - see amonthedeamon's answer
  • Change the fetch in your manifests to the prefix that works for you
    - <remote name="aosp" fetch="https://gitlab.com/...
    + <remote name="aosp" fetch="ssh://git@gitlab.com/...
    
    Note that this might not work for others, if the project is not public.
  • Authenticate via https using a token: change the fetch https URLs to use a token or a username / password

I haven't used this myself, but you can also override the URLs via a local manifest. Not sure if this only adds/removes project, or if you can actually override individual properties with a local configuration.

Kariem
  • 4,398
  • 3
  • 44
  • 73