Question

I want to work on some Android code together with others and need to set up repository to be used locally within the team. However, it seems like repo doesn't let me do that. And neither does cloning a git repository in the android repo like this:

$ git clone /var/android/.repo/projects/bionic.git/

I get the following error message:

Initialized empty Git repository in /home/user/mydroid/bionic/.git/
0 blocks
Warning: Remote HEAD refers to nonexistent ref, unable to checkout.

Has anyone tried successfully to work on a git repository in Android together with others without having to send to the Android project itself?


I've also tried to do the following, I've initiated a client at a shared computer and locally in my computer like this:

$ repo init -u git://android.git.kernel.org/platform/manifest.git

I also tried to add a remote for a seperate project (e.g. bionic) to the shared computer like this, but get an error:

$ git clone /initech/android/bionic
fatal: cannot clone empty repository

I also try to do it like this:

$ git clone /initech/android/.repo/projects/bionic.git/
Initialized empty Git repository in /home/user/mydroid/bionic/.git/
0 blocks
Warning: Remote HEAD refers to nonexistent ref, unable to checkout.

It finds a git repository, clones it, but can't find any references to checkout even if there is a topic branch in the remote. What gives?

Was it helpful?

Solution

I'm not sure what Repo is or does, but it seems to me like you want to clone git://android.git.kernel.org/platform/bionic.git:

git clone --bare git://android.git.kernel.org/platform/bionic.git

This clone can then be cloned again:

git clone bionic.git bionic-jim
cd bionic-jim
#edit
git commit -a -m "foo"
git push

Changes will be pushed to ../bionic.git. Someone then has to go into bionic.git and push to some upstream repository.

OTHER TIPS

The message “Warning: Remote HEAD refers to nonexistent ref, unable to checkout.” only tells you that the HEAD link does not exist and thus Git does not know which revision to check out to your local working directory. The .git directory is created and filled normally, though. Just do a git checkout <whatever-branch-you-want> and start hacking away.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top