使用git-repo管理多个git仓库

news/2025/1/31 11:06:18/

step 1: 下载repo

git-repo下载可在服务器端通过以下任一方式下载。

git clone https://gerrit.googlesource.com/git-repo (谷歌官方源)

git clone https://mirrors.tuna.tsinghua.edu.cn/git/git-repo (国内清华源)

git clone git-repo - Git at Google (国内中科大源)

step 0:建立私人的git-repo工具工程:
方法一,在git server上直接操作
git clone https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -b main
方法二,在本地操作,然后上传到git server:
# git clone --mirror  https://mirrors.tuna.tsinghua.edu.cn/git/git-repo  
git remote add gitrepo.git http://git.inspur.com/rk3588/gitrepo.git
git push -u gitrepo.git --all
git push -u gitrepo.git --tags   (可选)
#git config --global http.postBuffer 1048576000   //设置缓存为1G
# git config http.postBuffer 524288000  //查看 http.postBuffer数值是否设置成功

step 2 初始化工程和mainifest git仓库

step 1: 初始化 manifest git server端,用于规划整个项目的代码结构:
pakydu@ubuntu18-fttr:~/works/3588/mygit$ mkdir -p rk3588/manifest
pakydu@ubuntu18-fttr:~/works/3588/mygit$ cd rk3588/manifest/
pakydu@ubuntu18-fttr:~/works/3588/mygit/rk3588/manifest$ ls -al
pakydu@ubuntu18-fttr:~/works/3588/mygit/rk3588/manifest$ git init
Initialized empty Git repository in /home/pakydu/works/3588/mygit/rk3588/manifest/
pakydu@ubuntu18-fttr:~/works/3588/mygit/rk3588/manifest$#创建工程魔板:
vi default.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest><remote  name="linux"fetch="http://git.inspur.com/rk3588" /><default revision="master"remote="linux"sync-j="1" /><project path="kernel" name="kernel" /><project path="buildroot" name="rootfs" /><project path="u-boot" name="u-boot" /><project path="external/rockit" name="external/rockit" /></manifest>#提交工程模版git add *git commit  -m "add default.xml"git remote rm origin  (删除旧的)git remote add origin http://git.inspur.com/rk3588/manifest.gitgit branch maingit checkout maingit push http://git.inspur.com/rk3588/manifest.git

step 3: 上传每个git的代码:

$ git init (已被git管控代码可省略)
$ git add . (已被git管控代码可省略)
$ git commit -m "Init Code" (已被git管控代码可省略)
$ git push http://git.inspur.com/rk3588/kernel.git master  (master or main)$git init (已被git管控代码可省略)
$ git add . (已被git管控代码可省略)
$ git commit -m "Init Code" (已被git管控代码可省略)
$ git push http://git.inspur.com/rk3588/buildroot.git master
...

step 4: 在客户端上repo拉取服务器端代码

将REPO_URL = ‘https://gerrit.googlesource.com/git-repo’ 
修改为 REPO_URL = ‘http://git.inspur.com/rk3588/git-repo.git’
#git push http://git.inspur.com/rk3588/git-repo.git
#export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
#export REPO_URL='http://git.inspur.com/rk3588/git-repo.git'
repo init -u http://git.inspur.com/rk3588/manifest.git

Manifest示例

每个采用 repo 管理的复杂多仓库项目都需要一个对应的 manifest 仓库,如 AOSP 的 manifest ,此仓库用来存储所有子仓库的配置信息,repo 也是读取此仓库的配置文件来进行管理操作。里面的配置就是 xml 定义的结构,例如aosp default repository一般是default.xml。

<?xml version="1.0" encoding="UTF-8"?>
<manifest><default revision="refs/tags/android-13.0.0_r11"remote="aosp"sync-j="4" /><superproject name="platform/superproject" remote="aosp" revision="android-13.0.0_r11" /><contactinfo bugurl="go/repo-bug" /><project path="build/make" name="platform/build" groups="pdk" ><linkfile src="CleanSpec.mk" dest="build/CleanSpec.mk" /><linkfile src="buildspec.mk.default" dest="build/buildspec.mk.default" /><linkfile src="core" dest="build/core" /><linkfile src="envsetup.sh" dest="build/envsetup.sh" /><linkfile src="target" dest="build/target" /><linkfile src="tools" dest="build/tools" /></project><project path="build/bazel" name="platform/build/bazel" groups="pdk" ><linkfile src="bazel.WORKSPACE" dest="WORKSPACE" /><linkfile src="bazel.sh" dest="tools/bazel" /><linkfile src="bazel.BUILD" dest="BUILD" /></project><project path="build/bazel_common_rules" name="platform/build/bazel_common_rules" groups="pdk" /><project path="build/blueprint" name="platform/build/blueprint" groups="pdk,tradefed" /><project path="build/pesto" name="platform/build/pesto" groups="pdk" /><project path="build/soong" name="platform/build/soong" groups="pdk,tradefed" ><linkfile src="root.bp" dest="Android.bp" /><linkfile src="bootstrap.bash" dest="bootstrap.bash" /></project><!-- END open-source projects -->
</manifest>#示例
pakydu@ubuntu18-fttr:~/works/3588/rk3588_org/.repo$ cat manifests/rk3588/rk3588_linux_bsp_release_20230114_v1.0.6c.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest><include name="include/firefly_gitlab.xml" /><default remote="firefly-linux" sync-j="4" dest-branch="rk3588/firefly" revision="refs/tags/rk3588/linux_release_v1.0.6c"/><project name="u-boot" /><project name="docs" ><linkfile dest="docs/.Socs/RK3588/Rockchip_Developer_Guide_Linux_Software_CN.pdf" src="Rockchip_Developer_Guide_Linux_Software_CN.pdf"/></project><project name="docs-soc_internal" path="docs/.Socs" ><linkfile dest="docs/RK3588" src="RK3588"/></project><project name="device/rockchip" dest-branch="firefly" ><linkfile dest="mkfirmware.sh" src="common/mkfirmware.sh"/><linkfile dest="build.sh" src="common/build.sh"/><linkfile dest="rkflash.sh" src="common/rkflash.sh"/><linkfile dest="device/rockchip/.target_product" src="rk3588"/><linkfile dest="firefly-update.sh" src="common/firefly-update.sh"/></project><project name="tools" ><linkfile dest="tools/windows/RKDevTool/RKDevTool_Release/config.cfg" src="windows/RKDevTool/RKDevTool_Release/rk3588-config.cfg"/><linkfile dest="tools/windows/RKDevTool/rockdev/package-file" src="windows/RKDevTool/rockdev/rk3588-package-file"/><linkfile dest="tools/windows/RKDevTool/rockdev/mkupdate.bat" src="windows/RKDevTool/rockdev/rk3588-mkupdate.bat"/><linkfile dest="tools/linux/Linux_Pack_Firmware/rockdev/mkupdate.sh" src="linux/Linux_Pack_Firmware/rockdev/rk3588-mkupdate.sh"/><linkfile dest="tools/linux/Linux_Pack_Firmware/rockdev/package-file" src="linux/Linux_Pack_Firmware/rockdev/rk3588-package-file"/></project><project name="kernel" /><project name="prebuilts/gcc/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu" /><project name="prebuilts/gcc/linux-x86/arm/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf" /><project name="rkbin" />
</manifest>
pakydu@ubuntu18-fttr:~/works/3588/rk3588_org/.repo$ cat manifest.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest><include name="rk3588/rk3588_linux_bsp_release_20230114_v1.0.6c.xml" /><project name="external/security/rk_tee_user" /><project name="app/qfm" /><project name="app/QLauncher" /><project name="app/multivideoplayer" /><project name="app/qcamera" /><project name="app/qplayer" /><project name="app/qsetting" /><project name="buildroot" ><linkfile dest="Makefile" src="build/Makefile"/><linkfile dest="envsetup.sh" src="build/envsetup.sh"/></project><project name="external/drm-cursor" /><project name="external/alsa-config" /><project name="external/camera_engine_rkaiq" /><project name="external/chromium" /><project name="external/rkwifibt-app" /><project name="external/rockchip-test" /><project name="uefi" /><project name="external/rk_pcba_test" /><project name="external/rkscript" dest-branch="firefly"/><project name="external/rktoolkit" /><project name="external/rkupdate" /><project name="external/rkwifibt" /><project name="external/gstreamer-rockchip" /><project name="external/libmali" /><project name="external/linux-rga" /><project name="external/recovery" dest-branch="firefly"/><project name="external/security/bin" /><project name="external/xserver" /><project name="external/mpp" /><project name="external/rknn-toolkit2" /><project name="external/rknpu2" /><project name="external/security/librkcrypto" /><project name="external/rockit" />
</manifest>

参考:

https://www.exyb.cn/news/show-159545.html?action=onClick

总结常用repo命令 - 知乎

搭建repo服务器管理多个git工程_repo管理多个git_songze_lee的博客-CSDN博客


http://www.ppmy.cn/news/1115284.html

相关文章

node_modules/.bin/vue-cli-service: Permission denied

背景 因为有一些前端依赖的库是私服的&#xff0c;只有在局域网中才能下载到。所以我直接把node_modules复制过来直接使用的。我是从windows系统中复制到macOS中使用。 现象 npm run serve> fronted0.1.0 serve /Users/itkey/workspace/frontend > vue-cli-service se…

【计算机网络】 心跳机制

文章目录 心跳机制应用场景什么是心跳机制心跳包的发送&#xff0c;通常有两种技术 心跳机制 应用场景 在长连接下&#xff0c;有可能很长一段时间没有数据往来。理论上说&#xff0c;这个连接是一直保持连接的&#xff0c;但是实际情况中&#xff0c;如果中间节点出现什么故…

简单的手机电脑无线传输方案(android@windows)

文章目录 abstractwindows浏览android文件环境准备客户端软件无线网络链接步骤其他方法 手机浏览电脑文件公网局域网everythingpython http.server abstract windows访问android文件 android访问桌面系统上的文件 windows浏览android文件 环境准备 客户端软件 android手机…

「聊设计模式」之建造者模式(Builder)

&#x1f3c6;本文收录于《聊设计模式》专栏&#xff0c;专门攻坚指数级提升&#xff0c;助你一臂之力&#xff0c;带你早日登顶&#x1f680;&#xff0c;欢迎持续关注&&收藏&&订阅&#xff01; 前言 设计模式是众多优秀软件开发实践的总结和提炼&#xff0c;…

星际争霸之小霸王之小蜜蜂(十三)--接着奏乐接着舞

系列文章目录 星际争霸之小霸王之小蜜蜂&#xff08;十二&#xff09;--猫有九条命 星际争霸之小霸王之小蜜蜂&#xff08;十一&#xff09;--杀杀杀 星际争霸之小霸王之小蜜蜂&#xff08;十&#xff09;--鼠道 星际争霸之小霸王之小蜜蜂&#xff08;九&#xff09;--狂鼠之…

【逗老师的无线电】艾德克斯TTL串口转网口

最近手搓了一个可以用于艾德克斯ITECH电源或者电子负载的TTL串口转网口的模块&#xff0c;用上之后&#xff0c;上位机软件就可以配置以太网IP连接设备啦。就像这样。 一、ITECH TTL接口定义 二、整体逻辑 嗯&#xff0c;就这么简单。IT9000控制软件的Ethernet功能就是直接S…

CentOS安装mariadb

1、 安装 [rootlocalhost ~]# yum install mariadb mariadb-server2、 启动并自启 [rootecs-3f21 ~]# systemctl enable mariadb –now3、 查看启动状态 [rootecs-3f21 ~]# systemctl status mariadb4、 初始化mariadb并设置root密码 [rootecs-3f21 ~]# mysql_secure_inst…

Vue基础之模板语法介绍

前言 上篇我分享了关于Vue的入门&#xff0c;简单的入了个门。本篇文章将要分享的内容为Vue的模板语法。 一、插值 1.1、文本 1.2、html 1.3、属性 1.4、class、style绑定 1.5、表达式 在Vue的模板语法中&#xff0c;插值是一种常用的方式来动态地将数据渲染到视图中。Vue使用双…