将 repo 与 gitlab forks 一起使用

Using repo with gitlab forks

我正在尝试设置环境以将 Yocto 的源代码存储在我工作的公司的 GitLab 服务器中。

我已经毫无问题地将原始代码推送到存储库,他们克隆每个存储库的 url 是这样的:

git@git.at.mycompany.com:myuser/repo1.git

git@git.at.mycompany.com:myuser/repo2.git,

git@git.at.mycompany.com:myuser/repo3.git,

我想保持这段代码不变,所以我创建了一个组并分叉了每个存储库,这些分叉存储库的 URLS 是这样的:

git@git.at.mycompany.com:yocto-group/repo1.git

git@git.at.mycompany.com:yocto-group/repo2.git

git@git.at.mycompany.com:yocto-group/repo3.git

现在,考虑到这一点,我创建了包含以下内容的 default.xml 文件的清单存储库:

<?xml version="1.0" encoding="UTF-8"?>                                                                                                                                                                                                                                                                                                                                                                                                   
<manifest>                                                                                                                                                                                                                                                                                                                                                                                                                               
  <remote fetch="git@git.at.mycompany.com:yocto-group" name="mycompany"/>                                                                                                                                                                                                                                                                                                                                                            
  <default sync-j="1" remote="mycompany" />                                                                                                                                                                                                                                                                                                                                                                                               
  <project remote="mycompany" revision="4a68a44f56c725914cfa721993a2ea8a3dc6ebd5" name="repo1" path="sources/poky"/>                                                                                                                                                                                                                                                                                                                 
  <project remote="mycompany" revision="eabb07f6d2fc3318fd50f05d364372a96e0b12ed" name="repo2" path="sources/meta-security"/>                                                                                                                                                                                                                                                                                               
  <project remote="mycompany" revision="c6e7bf94debb7bdd7a2b52b222a4b0da732a24b4" name="repo3" path="sources/meta-virtualization"/>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
</manifest> 

我上传到 git@git.at.mycompany.com:yocto-group/manifests.git 然后像这样使用 repo:

repo init -u git@git.at.mycompany.com:yocto-group/manifests.git -m default.xml -b develop 输出是:

Get https://gerrit.googlesource.com/git-repo/clone.bundle
Get https://gerrit.googlesource.com/git-repo
remote: Finding sources: 100% (20/20)
remote: Total 20 (delta 4), reused 20 (delta 4)
Unpacking objects: 100% (20/20), done.
From https://gerrit.googlesource.com/git-repo
   34bc571..0b304c0  master     -> origin/master
Get git@git.at.mycompany.com:yocto-group/manifests.git
remote: Enumerating objects: 591, done.        
remote: Counting objects: 100% (591/591), done.        
remote: Compressing objects: 100% (322/322), done.        
remote: Total 591 (delta 284), reused 527 (delta 263)          
Receiving objects: 100% (591/591), 2.94 MiB | 661.00 KiB/s, done.
Resolving deltas: 100% (284/284), done.
From git.at.mycompany.com:yocto-group/manifests
 * [new tag]         LSDK-17.12-ls1012a-AB-tc1   -> LSDK-17.12-ls1012a-AB-tc1
 * [new tag]         LSDK-18.09                  -> LSDK-18.09
 * [new tag]         lx2160a-early-access-bsp0.1-p2 -> lx2160a-early-access-bsp0.1-p2
 * [new tag]         lx2160a-early-access-bsp0.2 -> lx2160a-early-access-bsp0.2
 * [new tag]         lx2160a-early-access-bsp0.3 -> lx2160a-early-access-bsp0.3
 * [new tag]         lx2160a-early-access-bsp0.4 -> lx2160a-early-access-bsp0.4
 * [new tag]         lx2160a-early-access-bsp0.4-p1 -> lx2160a-early-access-bsp0.4-p1
 * [new tag]         lx2160a-early-access-bsp0.4-p2 -> lx2160a-early-access-bsp0.4-p2
 * [new tag]         master-ls1046afrwy          -> master-ls1046afrwy
 * [new tag]         yocto_2.6_es_1906           -> yocto_2.6_es_1906
 * [new tag]         yocto_2.6_es_1909           -> yocto_2.6_es_1909
 * [new tag]         yocto_2.6_es_1909_update_291119 -> yocto_2.6_es_1909_update_291119
 * [new tag]         yocto_2.7                   -> yocto_2.7
 * [new branch]      develop                     -> origin/develop
 * [new branch]      master                      -> origin/master

Your identity is: Johan Duque <johan.duque@mycompany.com>
If you want to change this, please re-run 'repo init' with --config-name

repo has been initialized in /home/lex/Documents/yocto/tmp

一切顺利。

我做repo sync的时候出现问题, 我明白了:

> GitLab: The project you were looking for could not be found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

知道如何解决这个问题并在 repo sync 中取得成功吗?

我找到了解决这个问题的方法,我不得不像这样编辑遥控器:

<remote fetch="ssh://git@git.at.mycompany.com/yocto-group" name="mycompany"/>

我添加了协议并将 : 修改为 /