Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dropbox and git, could it cause conflicts?

Tags:

git

dropbox

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?

like image 246
Michiel Borkent Avatar asked Nov 22 '11 11:11

Michiel Borkent


People also ask

Can you use Git with Dropbox?

git-remote-dropbox is a transparent bidirectional bridge between Git and Dropbox. It lets you use a Dropbox folder or a shared folder as a Git remote! This Git remote helper makes Dropbox act like a true Git remote.


2 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.

like image 75
Tom Larkworthy Avatar answered Oct 12 '22 03:10

Tom Larkworthy


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.

like image 43
Rudi Avatar answered Oct 12 '22 02:10

Rudi