repo常用命令及常見問題匯總


1.執行repo命令的時候,總是顯示“project xx no found”

解決:

(1)先執行“repo forall -c pwd” 顯示所有project的路徑,按照這個來寫project參數路徑。

 2.repo如何提交代碼,參考:https://blog.csdn.net/zhanglianyu00/article/details/56845462

3.如何配置repo的mainfest.xml檢出分支或者tag

關於mainfest.xml中的參數格式和說明,可以自己查閱,此處不詳細寫,我們知道project中的reversion可以指定分支,tag,commitid等,那么如何書寫呢?

(1)分支:reversion可以直接寫分支的名字,如下:

               <project path="SDK/upnp" revision="develop" name="test/upnp"/>

  (2) tag:不能直接就寫一個tag名字,要加前綴refs/tags/,如下:

             <project path="SDK" revision="refs/tags/tag_r60008_18214" name="test/SDK"/>

mainfest.xml配置好后,repo init 可以指定當前修改所在的repo分支,比如剛才的改動是在mainfest倉庫的develop分支上改動的,repo init的時候,可以使用-b 指定分支,即 repo init -u gerrit:test/manifest -b develop 

如果基於tag:repo init -u gerrit:test/manifest -b refs/tags/tag_V1.3

repo start命令創建的分支是基於mainfest.xml 中的revision來創建的分支。

4.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 分支名

5.執行repo 查看支持的命令:

執行repo help command 或者repo command --help查看命令的詳細使用


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM