git fetch and
git checkout to downloads new changes and updates the working files in your local workspace. If you run repo sync without arguments, it synchronizes the files for all projects.
When you run repo sync, this is what happens:
Update manifest project.
Compare with the project list file (if exist) generated by last
git repo synccommand, and remove obsolete projects (if nothing changed).
If the project has never been synchronized, then
git repo syncis equivalent to
git clone. All branches in the remote repository are copied to the local project directory.
If the project has been synchronized before, then
git repo syncis equivalent to:
git remote update git rebase origin/<branch>
The branch is the currently checked-out branch in the local project directory. If the local branch isn’t tracking a branch in the remote repository, then no synchronization occurs for the project.
If the Git rebase operation results in merge conflicts, please use the standard Git commands (for example,
git rebase --continue) to resolve the conflicts.
After a successful run of
git repo sync, the code in specified projects is up to date and synced with the code in the remote repository.
git repo sync [options...]
-c: Fetch only the current manifest branch from the server.
-d: Switch specified projects back to the manifest revision. This is helpful if the project is currently on a topic branch, but the manifest revision is temporarily needed.
-f: Proceed with syncing other projects even if a project fails to sync.
-j <num>: Split the sync across threads for faster completion. Make sure not to overwhelm your machine by leaving some CPU reserved for other tasks. To see the number of available CPUs, first run: nproc –all
-q: Run quietly by suppressing status messages.
-n：Only run network part, i.e., only run
git fetch, do not run
-l：Only run local part, i.e., only run
git checkout, and do not run