Search code examples
repo

Clone a repo directly from manifest xml file without a git repository


I would like to clone a repo without having the manifest on a branch.

My build system creates static manifest files with repo manifest -o static.xml -r I'm looking for a smart way of checking out a workspace the exact same contents from those files.

Both the usual syntax of repo init -u url and previous answers to similair questions shows how this could be achieved if I put the static manifest files on a branch in a local git. However I would like avoid this extra step and checkout directly from my manifest.

Are there some other functionality in repo which could be used to achieve this?


Solution

  • From my investigations I have learnt it is not possible to create a repo from only a static manifest which was my first intentions.

    However it is possible to create a skeleton manifest on a branch and use it for init then copy a static xml file to .repo/manifest and sync with it without it being under version control.

    repo init -u remote/branch
    cp static.xml .repo/manifests/
    repo sync -m static.xml