0

I wanted to add MacOs support to my Java application. So I bought a new Mac with M1 Chip and created a new subbranch in my Git repository to add MacOs support. The repo is hosted on Dropbox. I have local repos on MacOs and Windows which point to this "remote" repo (Dropbox is added as folder in the home directory).

  1. On MacOs: I used SourceTree to clone the repository. After I finished the first bugfix I pushed to the repo. I can still push and pull on master and the subbranch. No prob on MacOs.

  2. On Windows: Since I pushed from MacOs I have the problem ONLY on Windows. I tried with TortoiseGit, SourceTree and directly on console with "git pull origin master". The result is always fine for the master branch (where I did not push from MacOs yet) but for the subbranch I always get "error: refs/heads/v0.6.x does not point to a valid object!". Doing "git fsck" gives only "dangling tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904". I removed the head branch locally and remotely. It is still there on MacOs but on Windows I get the same error message when I pull from the repo.

Additional Info: The folder refs\heads\v0.6.x exists. So I guess it is pretty sure a problem with the check-in from MacOs.

Any Ideas are very welcome.

Shark
  • 31
  • 1
  • 1
    *The repo is hosted on Dropbox.* Don't do that. That's the source of the problem. Never store any repository on any file system on which some software other than Git makes decisions about resolving file content. – torek Mar 20 '21 at 22:57
  • @torek Thanks for your answer. But [here](https://stackoverflow.com/questions/1960799/how-to-use-git-and-dropbox-together) it is stated that this should be no problem. – Shark Mar 21 '21 at 08:22
  • Read the comments under that answer. Also, note that the user stores specifically one bare repository on Dropbox and clones that bare repository to each of the various computers. That's *more* reliable than putting a non-bare repository in Dropbox, but still not a good idea. – torek Mar 21 '21 at 18:19
  • BTW, having scanned through other answers and taken a quick look at git-remote-dropbox, that Git add-on seems like a reasonable way to store a repository in Dropbox: by using the API, rather than the file system, it can get things to happen in the right order. Since it only stores loose objects, it's probably not suitable for large repositories, though. – torek Mar 21 '21 at 18:30

0 Answers0