自学内容网 自学内容网

AOSP的同步问题

在这里插入图片描述

repo sync同步时提示出错:

error: .repo/manifests/: contains uncommitted changes
================================================================================
Repo command failed due to the following `UpdateManifestError` errors:
contains uncommitted changes

解决方法:

1、cd 进入.repo/manifests

cd .repo/manifests

2、执行如下三条命令

git stash
git clean -f -d

3、重新开始同步

repo sync -c -j4 --no-clone-bundle

后续:repo版本需要更新

info: A new version of repo is available
warning: repo is not tracking a remote branch, so it will not receive updates
================================================================================
Repo command failed: RepoUnhandledExceptionError
        GitCommandError: 'reset --keep v2.49.3^0' on repo failed
stderr: error: Entry 'color.py' not uptodate. Cannot merge.
fatal: Could not reset index file to revision 'v2.49.3^0'.
cd .repo/repo
git fetch --all
git reset --hard origin/master
 git pull
  1. git pull 有问题:
sing@WIN-A5BMKCI040U:~/WORK_DIRECTORY/aosp/.repo/repo$ git pull
hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint:
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.

根据提示: git pull --rebase

  1. git pull --rebase 有问题:
sing@WIN-A5BMKCI040U:~/WORK_DIRECTORY/aosp/.repo/repo$ git pull --rebase
Auto-merging README.md
Auto-merging SUBMITTING_PATCHES.md
CONFLICT (content): Merge conflict in SUBMITTING_PATCHES.md
Auto-merging docs/internal-fs-layout.md
Auto-merging docs/manifest-format.md
Auto-merging docs/python-support.md
CONFLICT (content): Merge conflict in docs/python-support.md
Auto-merging docs/release-process.md
Auto-merging docs/repo-hooks.md
error: could not apply a99f19f... docs: add deprecated branch banner
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".

根据提示:

git rm SUBMITTING_PATCHES.md
git rm  docs/python-support.md
 git rebase --continue
  1. 最后再执行一下
sing@WIN-A5BMKCI040U:~/WORK_DIRECTORY/aosp/.repo/repo$ git pull
Already up to date.

后续:同步期间,仍然出现未提交提示

比如:

error: tools/test/graphicsbenchmark: Cannot remove project: uncommitted changes are present.

error: Local checkouts *not* updated.
================================================================================
Repo command failed due to the following `SyncFailFastError` errors:
error: tools/test/graphicsbenchmark: Cannot remove project: uncommitted changes are present.

我们去.repo/manifest里面,输入git status
得到:

On branch default
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean

此时,我们可以按如下操作:

cd tools/test/graphicsbenchmark/
git add .
git stash
git stash clear

最后,输入:

repo sync -j1 --fail-fast

继续同步。


原文地址:https://blog.csdn.net/m0_59690208/article/details/144132093

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!