when i repo init, some error occur: error.GitError: --force-sync not enabled; cannot overwrite a local work tree.

2,473 views
Skip to first unread message

Shuaiqi Li

unread,
Sep 10, 2018, 2:06:36 AM9/10/18
to Repo and Gerrit Discussion
when i do this:   repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-7.1.1_r25,some error will occur:


* [new tag]         studio-3.1.2 -> studio-3.1.2
 * [new tag]         studio_0.8.6 -> studio_0.8.6
 * [new tag]         studio_1.0.0 -> studio_1.0.0
 * [new tag]         studio_1.0.1 -> studio_1.0.1
 * [new tag]         ub-jack-arzon-mr2 -> ub-jack-arzon-mr2
 * [new tag]         webview-m40_r1 -> webview-m40_r1
 * [new tag]         webview-m40_r2 -> webview-m40_r2
 * [new tag]         webview-m40_r3 -> webview-m40_r3
 * [new tag]         webview-m40_r4 -> webview-m40_r4
Traceback (most recent call last):
  File "/home/android/aosp711/.repo/repo/main.py", line 531, in <module>
    _Main(sys.argv[1:])
  File "/home/android/aosp711/.repo/repo/main.py", line 507, in _Main
    result = repo._Run(argv) or 0
  File "/home/android/aosp711/.repo/repo/main.py", line 180, in _Run
    result = cmd.Execute(copts, cargs)
  File "/home/android/aosp711/.repo/repo/subcmds/init.py", line 399, in Execute
    self._SyncManifest(opt)
  File "/home/android/aosp711/.repo/repo/subcmds/init.py", line 245, in _SyncManifest
    m.MetaBranchSwitch()
  File "/home/android/aosp711/.repo/repo/project.py", line 2913, in MetaBranchSwitch
    self.Sync_LocalHalf(syncbuf)
  File "/home/android/aosp711/.repo/repo/project.py", line 1327, in Sync_LocalHalf
    self._InitWorkTree(force_sync=force_sync)
  File "/home/android/aosp711/.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.


repo_init_error.jpg

David Pursehouse

unread,
Sep 10, 2018, 4:08:06 AM9/10/18
to Shuaiqi Li, Repo and Gerrit Discussion
It looks like you did this in a location where a repo workspace already exists, and there are changes made on the .repo/manifests project (which is a clone of the platform/manifest repository).

To fix this you should try:

- Check what changes have been made in the .repo/manifests and either commit them or reset it

Or:

- Do the init in a completely clean workspace, i.e. where there is no .repo folder

 


--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages