当前位置:   article > 正文

repo安装管理本地git库_invalid clone.bundle file; ignoring.

invalid clone.bundle file; ignoring.

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档


前言

在项目中使用git管理源码,在某些项目中涉及到多个git库,手动进行更新,需进入每个库进行更新等操作,如涉及库较多,更新繁琐不说,还容易遗漏,正是如此才引入repo工具进行管理。本文就介绍了repo安装,与使用基本。


一、repo安装

安装命令:

curl https://storage.googleapis.com/git-repo-downloads/repo > /bin/repo
  • 1

修改repo

	REPO_URL = 'https://gerrit.googlesource.com/git-repo'
  • 1

修改为

   REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
  • 1

然后运行路径配置执行

PATH=~/bin:$PATH  
  • 1

二、建立本地manifest库

1.xml 文件

default.xml(示例):

<?xml version="1.0" encoding="UTF-8"?>
<manifest>

	<remote name="gitlab" 
		 fetch="http://localhost/xxxx/" />
	     	
	<default revision="repo" remote="gitlab" sync-j ="2"/>

	<project path="base/test" name="test" groups="gitlab" revision="main"/>

</manifest>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

配置说明


  <remote name="每个库的远程名"

          alias="会覆盖name的值"

          review="repo upload的hostname,repo upload时必须指定这个值"

          fetch="所有子库的git url前缀,一般是.或.."

          #fetch是".",各个具体的代码仓库与manifest目录同级则manifests库的路径组成分别是base_url/pro1/manifests和base_url/pro1/project-name,即

          #fetch是"..",则各个具体的代码仓库的URL是base_url/project-name,即与manifest上一级目录同级

          revision="会被default中的revision覆盖">

  <default remote="与remote的name一致"

            revision="branch"

            dest-branch="未设置则用revision的值"

            sync-j=""  #如果repo sync 没有加-j选项,则使用这里指定的值

            sync-c="true" #等同于 repo sync -c选项,sync当前revision

            sync-s="true" #sync子项目>

  <project name="名称唯一,${remote_fetch}/${project_name}.git"

            path="项目的路径,如果没有path,则用name的值作为path"

            remote=""

            revision=""

            dest-branch="repo upload 所上传的分支"

            groups="a,b"

            sync-c="true"

            sync-s="true"

            upstream="sha1,repo sync -c ,则sync这个指定的sha1"

            clone-depth="会被--depth覆盖"

            force-path="根据path或name值创建本地的mirror库,只有使用--mirror的时候这个才生效"

            >

  <remove-project 属性值同project>

  <include name="用manifest库的相对路径"> 

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55

然后将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

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

然后输入

$ 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.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

总结

repo安装使用也是网上参考众多教程,然后记录自己的安装配置过程,避免以后遗忘,又得网上重新各种百度

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/636657
推荐阅读
相关标签
  

闽ICP备14008679号