Repo(google git-repo)使用实例

来源:互联网 发布:php编辑器 编辑:程序博客网 时间:2024/05/22 03:29

remote:

$ pwd/home/kylin/test/repo$ git init --bareInitialized empty Git repository in /home/kylin/test/repo/

local:

下载repo

➜  ~ curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo > ~/bin/repo➜  ~ export PATH=~/bin:$PATH

manifest.xml

➜  repo_clt pwd/home/kylin/test/repo_clt➜  repo_clt cat .repo/manifests/dft.xml <manifest>      <remote name="aosp" fetch="/home/kylin/test/" review="gerrit"/>      <default revision="refs/HEAD/master" remote="aosp" sync-j="4"/>      <!--  Developer extras  -->      <project path="test_repo" name="repo" revision="master" groups="devel"/>  </manifest>

同步代码

➜  repo_clt repo init -u ssh://kylin@116.x.x.70/~/test/repo -m dft.xml➜  repo_clt repo sync

目录结构

➜  repo_clt tree -a -L 2.├── .repo│   ├── manifests│   ├── manifests.git│   ├── manifest.xml -> manifests/dft.xml│   ├── project.list│   ├── project-objects│   ├── projects│   ├── repo│   └── .repo_fetchtimes.json└── test_repo    ├── .git    └── README.md8 directories, 4 files

repo 参数

➜  repo_clt repo help --all        usage: repo COMMAND [ARGS]The complete list of recognized repo commands are:  abandon        Permanently abandon a development branch  branch         View current topic branches  branches       View current topic branches  checkout       Checkout a branch for development  cherry-pick    Cherry-pick a change.  diff           Show changes between commit and working tree  diffmanifests  Manifest diff utility  download       Download and checkout a change  forall         Run a shell command in each project  gitc-delete    Delete a GITC Client.  gitc-init      Initialize a GITC Client.  grep           Print lines matching a pattern  help           Display detailed help on a command  info           Get info on the manifest branch, current branch or unmerged branches  init           Initialize repo in the current directory  list           List projects and their associated directories  manifest       Manifest inspection utility  overview       Display overview of unmerged project branches  prune          Prune (delete) already merged topics  push           Push changes (bypass code review)  rebase         Rebase local branches on upstream branch  selfupdate     Update repo to the latest version  smartsync      Update working tree to the latest known good revision  stage          Stage file(s) for commit  start          Start a new branch for development  status         Show the working tree status  sync           Update working tree to the latest revision  upload         Upload changes for code review  version        Display the version of repoSee 'repo help <command>' for more information on a specific command.
0 0