Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
474 views
in Technique[技术] by (71.8m points)

github - git error `fatal: failed to read object` when pushing from a repo on Dropbox on a new machine

I have a repository on my old computer stored on Dropbox. I recently bought a new computer (which I currently don't have access to), downloaded Dropbox, synced the repository folder from Dropbox, and tried to make changes and push them to the repository. However, I receive the error:

fatal: failed to read object 21519a1bca9bbabb1c3185336a974cedca25b0dc: Input/output error
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
error: failed to push some refs to 'https://github.com/user/my-repo.git'

(where I have changed the actual username/repo name).

There are some other questions about these failures, but nothing I could find as simple as my situation. Using git with Dropbox is sometimes cautioned, but this seems to be unexpected behaviour as far as I can tell.

I've tried searching for the objects referred to but I can't find them in the stream of other objects in .git/objects.

question from:https://stackoverflow.com/questions/66046358/git-error-fatal-failed-to-read-object-when-pushing-from-a-repo-on-dropbox-on

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I answered my own question using the answer here: fatal: failed to read object X Input/output error fatal: index-pack failed - Git pull with Dropbox

Even though I thought my whole repository had been synced locally, going into the .git file showed that only some folders had been synced locally by 'Smart sync'. Right-clicking and choosing Smart sync -> local for each folder not locally synced fixed the issue.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...