Import repository from git to gerrit

后端 未结 4 1689
日久生厌
日久生厌 2021-02-01 03:57

I have two questions about Gerrit:

  1. How do I convert or import an already existing Git repository into Gerrit\'s format? There were a lot of com

4条回答
  •  被撕碎了的回忆
    2021-02-01 04:16

    First of all: There is no special "Gerrit format". Gerrit works with regular git repositories.

    1. Create a new project in Gerrit (without an initial commit). Add the created repository as a remote to your existing repository and simply push. You can configure Gerrit to allow direct pushing into the repository (bypassing review), allowing you to import the entire repository.

      Alternatively, if you have direct access to Gerrit's repository location (e.g. via SSH or on the local filesystem), you can just push directly into the repository (whereever Gerrit created it), bypassing Gerrit entirely. You'll need to flush the Gerrit caches afterwards, however, for Gerrit to notice that the repository HEADs have updated.

    2. As said, there is no "Gerrit format". Just clone your repository from gerrit, and all is well. You don't need to worry about any special branches.

提交回复
热议问题