git工具 -- repo

 

资料1:

https://wladimir-tm4pda.github.io/source/git-repo.html

 

sync命令:

repo sync [project-list ]

Downloads new changes and updates the working files in your local environment. After a successful repo sync, the code in specified projects will be up to date with the code in the remote repository.

You can specify project-list as a list of names or a list of paths to local source directories for the projects:
repo sync [proj1 proj2 ... projN ]

If you run repo sync without any arguments, it will synchronize the files for all the projects.

How Repo synchronization works

When you run repo sync, this is what happens:
  1. If the project has never been synchronized, then repo sync is equivalent to git clone. All branches in the remote repository are copied to the local project directory.
  2. If the project has already been synchronized once, then repo sync is equivalent to:
    git remote update
    git rebase origin/branch
    where branch is the currently checked-out branch in the local project directory. If the local branch is not tracking a branch in the remote repository, then no synchronization will occur for the project.

    If the git rebase operation results in merge conflicts, you will need to use the normal Git commands (for example, git rebase --continue) to resolve the conflicts.

The repo sync command also updates the private repositories in the .repo/ directory.

 


 

start

repo start newbranchname [project-list ]

Starts a new branch for development.

The newbranchname argument should provide a short description of the change you are trying to make to the projects.If you don't know, consider using the name default.

The project-list specifies which projects will participate in this topic branch. You can specify project-list as a list of names or a list of paths to local working directories for the projects:
repo start default [proj1 proj2 ... projN ]

"." is a useful shorthand for the project in the current working directory.

posted @ 2021-02-11 16:59  JadeCicada  阅读(132)  评论(0编辑  收藏  举报