Search code examples
androidgitrepo

Repo (GIT) how to update a manifest file when using a mirror?


We initiated a repo locally using an existing manifest.

repo init -u ssh://ger-repository/my_project-manifests -m my_manifest.xml --mirror  

Now, the manifest file changed. Running the init command is not possible:

fatal: --mirror not supported on existing client

How can we update the manifest without deleting all mirror folder and re-syncing again?


Solution

  • This might not be possible, considering this patch which proposed to replace that error message with:

    fatal: --mirror is only supported when initializing a new workspace.
    Either delete the .repo folder in this workspace, or initialize in another location.
    

    If this is about the same repos, but with a different URL, then this thread mentioned:

    If you've been able to clone all the gits you're almost there, just use the insteadOf trick on the clients if the relative URLs aren't available in the manifest you're mirroring.

    [url "https://yourserver.example.com/"]
            insteadOf = https://android.googlesource.com/