aosp mirror repo sync --force-sync

2,802 views
Skip to first unread message

Dean Wheatley

unread,
Oct 24, 2016, 6:37:44 AM10/24/16
to Repo and Gerrit Discussion
My aosp mirror is throwing the following error since 12 Oct:

$ repo sync
Traceback (most recent call last):
  File "/media/git/aosp/.repo/repo/main.py", line 531, in <module>
    _Main(sys.argv[1:])
  File "/media/git/aosp/.repo/repo/main.py", line 507, in _Main
    result = repo._Run(argv) or 0
  File "/media/git/aosp/.repo/repo/main.py", line 180, in _Run
    result = cmd.Execute(copts, cargs)
  File "/media/git/aosp/.repo/repo/subcmds/sync.py", line 726, in Execute
    mp.Sync_LocalHalf(syncbuf)
  File "/media/git/aosp/.repo/repo/project.py", line 1327, in Sync_LocalHalf
    self._InitWorkTree(force_sync=force_sync)
  File "/media/git/aosp/.repo/repo/project.py", line 2477, in _InitWorkTree
    raise e
error.GitError: --force-sync not enabled; cannot overwrite a local work tree. If you're comfortable with the possibility of losing the work tree's git metadata, use `repo sync --force-sync .repo/manifests` to proceed.

Can someone confirm what the effects are of running repo sync --force-sync on the mirror?
Will it delete all of my local branches?
Will this happen only for the mirror/manifest project, or for all projects specified in the mirror?

Thanks,
Message has been deleted

Dean Wheatley

unread,
Oct 24, 2016, 4:01:26 PM10/24/16
to Repo and Gerrit Discussion
repo sync --force-sync .repo/manifests

didn't work, but this worked to update my aosp mirrorgit :

$ cd /media/git/aosp/.repo/manifests
$ git status
On branch default
Your branch is behind 'origin/master' by 15 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
nothing to commit, working directory clean
$ git pull origin
$ cd /media/git/aosp
$ repo sync

Still not sure why repo sync wasn't able to fast-forward the .repo/manifests project.

Dean Wheatley

unread,
Nov 8, 2016, 5:07:51 AM11/8/16
to Repo and Gerrit Discussion
This happened again after the https://android.googlesource.com/mirror/manifest/+/b6e8ff0ce29afddc632cb5010f8fd410c07a0b3d update. Same error thrown by repo script.
Appreciate any pointers of what I should be looking for in the .repo/manifests project.

Dean Wheatley

unread,
Dec 9, 2016, 6:50:59 PM12/9/16
to Repo and Gerrit Discussion
I resolved this issue by deleting .repo/manifests/.git/packed-refs and .repo/manifests.git/packed-refs, and re-running repo sync. The mirror syncing is now working reliably.
Reply all
Reply to author
Forward
0 new messages