dead programmer
dead programmer

Reputation: 4373

How do I create a branch using git and repo tools while working with android code

I downloaded the android code from source.android.com. Then I created a new branch from this code:

repo start mybranch platform/external/webkit

Then I tried to switch to the new branch using :

git checkout mybranch

which failed with this error message:

fatal: Not a git repository (or any parent up to mount parent /media) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

I tried the steps mentioned in the android link.

One more problem: when I use the command

repo branch 

it shows only the branch which I created eailer. How can I switch between the code I have downloaded and the code I have made changes to?

Upvotes: 1

Views: 1402

Answers (1)

Bjarke Freund-Hansen
Bjarke Freund-Hansen

Reputation: 30138

The android source consists of several hundred git repositories. The repo tool helps maintain all these repositories.

Therefore when you are directly in the root of your android clone, you are not actually in a git repository. You have to enter a sub-directory containing a git repository before you can start using git commands.

For example the build/ directory is a git repository itself, you can try:

$ cd build/
$ git checkout mybranch

Which sub-directory you need to enter of cause depends on where you want to modify the android source. :)

Upvotes: 1

Related Questions