Search code examples
android-sourcerepository

Resuming Repo sync operation when getting android's source code


I followed the instructions here and ran repo sync The issue is at this exact time my disk ran out of space accordingly. I have another computer and I wonder if I simply copy the .repo and run repo sync again will that work? Or is there any way out.


Solution

  • I made a small research and here is my answer. As you may know AOSP consists of a lot of separate git projects and repo is a tool built on top of git commands to facilitate dealing with all these git projects. This webpage tells that repo sync command during the first time corresponds to git clone command. As far as I understand if git clone command is interrupted it is recommended to delete unfinished repository clone and start the command once again:

    When cloning a large repository (such as KDE, Open Office, Linux kernel) there is currently no way to restart an interrupted clone. It may take considerable time for a user on the end of a small pipe to download the data, and if the clone is interrupted in the middle the user currently needs to start over from the beginning and try again. For some users this may make it impossible to clone a large repository.

    However, some users also ask how to correct unsuccessful clone and give some receipts how to do this here. The main point is to run the following commands:

    $ git fetch
    $ git rebase -hard
    

    At the same time, if you run repo sync command for the second time it corresponds to commands for each project:

    git remote update 
    git rebase origin/BRANCH 
    

    I do not know git well and do not know the differences between the commands but to my point of view the commands perform similar actions. So my reccomendation is at first try to copy from the folder from one computer to the second and run repo sync command on the second computer once again. If it fails then remove the sources and start the process once again.

    Also repo forall command can be useful for you if you decide to work with each git project separately.