Just installed git on Windows. I set the GIT_DIR variable to be c:\\git\\ and verified that this environment variable is maintained by cygwin (i.e. echo $GIT_DIR is what it
If none of the above usual ways help you, look at the call trace underneath this error message ("fatal: This operation . . ."
) and locate the script and line which is raising the actual error. Once you locate that error() call, disable it and see if the operation you are trying completes even with some warnings/messages - ignore them for now. If so, finally after completing it might mention the part of the operation that was not completed successfully. Now, address this part separately as applicable.
Relating above logic to my case, I was getting this error message "fatal: This operation . . ."
when I was trying to get the Android-x86 code with repo sync . . .
. and the call trace showed raise GitError("cannot initialize work tree")
as the error() call causing the above error message ("fatal: . . ."
). So, after commenting that GitError()
in .repo/repo/project.py
, repo sync . . .
continued and finally indicated error for three projects that were not properly synced. I just deleted their *.git
folders from their relevant paths in the Android-x86 source tree locally and ran repo sync . . .
again and tasted success!