Without using third-party integration tools, I could enhance the condition a bit and use DropBox and other similar cloud disk services such as SpiderOak with Git.
The goal is to avoid the synchronization in the middle of these files modifications, as it can upload a partial state and will then download it back, completely corrupting your git state.
To avoid this issue, I did:
- Bundle my git index in one file using
git bundle create my_repo.git --all
.
- Set a delay for the file monitoring, eg 5 minutes, instead of instantaneous. This reduces the chances DropBox synchronizes a partial state in the middle of a change. It also helps greatly when modifying files on the cloud disk on-the-fly (such as with instantaneous saving note-taking apps).
It's not perfect as there is no guarantee it won't mess up the git state again, but it helps and for the moment I did not get any issue.