Bja*_*sen 13 git android repository
当我repo sync在Android存储库中执行操作时,幕后会发生什么?
是等同于repo forall -c "git pull"git fetch还是git fetch?或者它做了更复杂的事情?
谢谢
Mar*_*air 16
在这个页面上有一个描述是什么repo sync.在通常情况下,它会更喜欢git pull --rebase比git pull.引用该页面的内容:
Repo同步如何工作
当您运行repo sync时,会发生以下情况:
如果项目从未同步过,则repo sync等同于git clone.远程存储库中的所有分支都将复制到本地项目目录.
如果项目已经同步一次,那么repo sync相当于:
Run Code Online (Sandbox Code Playgroud)git remote update git rebase origin/branch其中branch是本地项目目录中当前已签出的分支.如果本地分支未跟踪远程存储库中的分支,则不会对项目进行同步.
如果git rebase操作导致合并冲突,则需要使用常规Git命令(例如
git rebase --continue)来解决冲突.repo sync命令还会更新
.repo/目录中的专用存储库.
基本上,通过运行git remote update确保您的远程跟踪分支(包括origin/branch)是最新的git fetch origin. (事实上,行为git remote update比这更复杂,并且取决于你的git配置,但在典型的设置中,它将git fetch [remotename]为你的每个遥控器运行.) 然后通过重播你不存在的所有提交来git rebase origin/branch重写你branch的上游到origin/branch.
| 归档时间: |
|
| 查看次数: |
8519 次 |
| 最近记录: |