What if one hosts a code repo in the Dropbox folder and shares it with others who collaborate. What happens if two people push to the Dropbox repo at the same time? Could this cause conflicts that mess up git?
-
possible duplicate of [Using Git and Dropbox together effectively?](http://stackoverflow.com/questions/1960799/using-git-and-dropbox-together-effectively) – user94559 Mar 04 '14 at 17:05
3 Answers
I tested this here: http://edinburghhacklab.com/2012/11/when-git-on-dropbox-conflicts-no-problem/
Conflicts are minor issues. When a corruption occurs no-one can push, so its not a fail silently situation. The fix is to remove all files in dropbox with the (XXX's conflicted copy) suffix.
After that is done someone's commit will not have gone through, so they should just git push again and it will all be fixed!
I have been using this setup for some time very successfully.

- 2,104
- 1
- 20
- 29
-
3Great link. Thanks. I have also been doing this for years and never ran into an issue. Nice to know that the potential issue is very minor – SwimBikeRun May 22 '14 at 00:00
Dropbox is not the right kind of hosting service to share Git repositories. You can get all kinds of trouble in the moment when a conflict inside .git/ occurs (and such conflicts can even occur in a unchanged repo, for example when one runs git gc
), since the content of the .git directory is not designed to be easily merged.
You can use https://bitbucket.org as an provider when you don't want public accessible repos.

- 19,366
- 3
- 55
- 77
-
3Dropbox is the right tool if you want cheap backup of a repository you don't share with anyone. If you share it, then it's going to make you and your collaborators suffer great pain. – Romain Nov 22 '11 at 14:00
-
2I just Dropbox to store all my Git repos, some being enormous (paid Dropbox account). No one else but me has access to the Dropbox folder but I do use it on two different computers sometimes switching back and forth at the same desk. I been doing this now for about 6 months and have not had a single issue. I think the warning is just as a precaution. But these are just local dev files. I use Bitbucket for hosting. – Brady Aug 07 '15 at 11:14
First, they will never push to the repo at 'the same time'. One will always be first and the other will be second.
Next, that is exactly the type of problem git (and other VCS's) are specialized for. Their algorithms determine if the changes conflict, and if so by how much.
So, ideally, there may be issues, but the second push
er will be notified of these conflicts and asked to resolve them before they are able to successfully push
/merge
to the repo.

- 1,602
- 2
- 23
- 51
-
The problem is, that Git is not in control of the merging Dropbox does when two users change a shared folder at (virtually) the same time. – tobiasbayer Nov 22 '11 at 12:03