linux环境如何配置repo

(1)下载repo

       mkdir ~/bin
       curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/bin/repo
       chmod a+x ~/bin/repo

(2)配置环境变量(在/etc/profile 或者~/.bashrc中添加如下,添加完成后执行source /etc/profile或者source ~/.bashrc使配置生效)

       export PATH=~/bin:$PATH
       export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'

(3)配置本地gerrit,添加自己的信息(修改~/.gitconfig)

       [user]
            email = anl@hpplay.cn # 修改为你自己的信息
            name = anl # 修改为你自己的信息
      [core]
          editor = vi
      [color]
          ui = auto
      [url "ssh://anl@192.168.8.2:29418/"] # 修改为你自己的gerrit的下载链接信息
           insteadOf = "gerrit:"

(4)下载代码

        repo init -u gerrit:test/manifest -b 分支名
        repo sync -j4
        repo start --all 分支名

 

 

原文地址:https://www.cnblogs.com/zndxall/p/10007755.html