Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I share code via git with others having the Android repo?

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?

like image 579
Spoike Avatar asked Mar 13 '09 14:03

Spoike


People also ask

Does Android studio have GitHub integration?

With Android Studio, you don't need to use the terminal to contribute to an Android project on GitHub. It has native integration with git and GitHub to allow most actions via the Android Studio UI. When you open Android Studio, it offers the option to open a project from version control. That's the option we'll use.

How do I clone a Git repo mobile?

Clone a Remote Repository using SGit Open the SGit client, if you have not already. Click on the Clone button. SGit will clone (download) the remote repo locally.


2 Answers

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.

like image 149
sebnow Avatar answered Oct 25 '22 07:10

sebnow


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.

like image 22
Bombe Avatar answered Oct 25 '22 05:10

Bombe