Search code examples
gitgit-repo

How can I update the manifest with the checked out commits/branches?


My manifest.xml has all my repositories cloning master. I do some work on few repositories and create new commits, branches and tags. Now, I want to save in the manifest where all these repositories are, which branch, tags or commits.

How can I do it? I'm trying to switch from git submodules to git-repo.


Solution

  • To save the status of the current repositories to foo.xml, run

    repo manifest -r -o foo.xml
    

    Make sure the new commits have been pushed to the branches/tags. Otherwise, it would raise errors if foo.xml is used to repo sync these repositories from the remote server specified in foo.xml.

    You can add and commit foo.xml in .repo/manifests and push it to the remote manifest repository, so that you and others can use it to repo sync the same repositories with the same revisions.

    It's better not to overwrite manifest.xml with foo.xml. The manifest.xml is used to download the latest revision, and foo.xml is used to download the specific revision.