文章目录提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
- 前言
- 一、repo安装
- 二、建立本地manifest库
- 1.xml 文件
- 2.repo 管理
- 总结
前言
在项目中使用git管理源码,在某些项目中涉及到多个git库,手动进行更新,需进入每个库进行更新等操作,如涉及库较多,更新繁琐不说,还容易遗漏,正是如此才引入repo工具进行管理。本文就介绍了repo安装,与使用基本。
一、repo安装
安装命令:
curl https://storage.googleapis.com/git-repo-downloads/repo > /bin/repo
修改repo
将
REPO_URL = 'https://gerrit.googlesource.com/git-repo'
修改为
REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
然后运行路径配置执行
PATH=~/bin:$PATH二、建立本地manifest库 1.xml 文件
default.xml(示例):
配置说明
然后将manifest提交到本地服务器
2.repo 管理命令(示例):
repo init -u http://localhost/manifest.git project .repo/manifests/ 更新 605cc3b..90c1cfc Fast-forward Your identity is: xxxxx xxxxx If you want to change this, please re-run 'repo init' with --config-name repo has been initialized in /data/home/bin/ If this is not the directory in which you want to initialize repo, please run: rm -r /data/home/bin//.repo
然后输入
$ repo sync Fetching: 0% (0/2) warming upInvalid clone.bundle file; ignoring. Fetching: 100% (2/2), done in 0.811s Garbage collecting: 100% (2/2), done in 0.029s repo sync has finished successfully.
总结
repo安装使用也是网上参考众多教程,然后记录自己的安装配置过程,避免以后遗忘,又得网上重新各种百度



