Reputation:
I have a setup where the entire projects
folder is synchronized in real time across several computers (think something like Dropbox). Inside that folder I might have an individual project folder like project-A
. Then inside the project folder I always have source
and documents
folders.
I want to keep the source
folder under version control, but not the documents
. So I clone my sources into the source
folder. This means that my local git repo will be synced across multiple machines (possibly both Linux and Windows).
Is this going to cause problems and screw up my git repo in some way I am not aware of? I don't know if I can disable the syncing of the source folders, and even if I could, someone else might forget to do that and have problems. I've thought about separating the source and documents into separate root folders where only one of them is synced, and the other isn't, but I would really like to keep all of the project files in one folder if possible.
Any ideas on the best way to do this?
[edit] For clarification, the git repo is cloned from Kiln (online git repo), but it just so happens that the location is is cloned it is synced across multiple computers.
Upvotes: 2
Views: 194
Reputation: 17837
I've kept my code checkouts in Dropbox now for 5 years writing code most every day. I use this to sync these changes between my desktop and laptop. This includes doing large refactorings that change dozens of files at a time.
Very rarely I have encountered problems, though they have a couple of times been severe (a corrupted repository) so you need to push early and often. Those rare problems are well worth the incredible convenience of being to continue work from right where you left off when switching between machines.
I've also tried this with Transporter with much, much less success. The Transporter file watcher doesn't seem as good, which led to conflicts every few weeks. Additionally, the syncing is much slower—whereas Dropbox seems to get things matched within a few seconds if both machines are up on the same network, Transporter had a median time of 30 seconds, but sometimes up to a few minutes.
Upvotes: 0
Reputation: 3388
If you are only using the sources, and not using the git
features of the repository, then sure- it's safe.
However, if you are actually planning to pull / push / diff or anything that actually uses git, then this is a bad idea.
rsync
is often used for syncing git repositories and it is safe to use for this purpose, but dropbox is not, as it could end up causing corruption.
Upvotes: 0
Reputation: 115859
Generally speaking, syncing Git/Mercurial repositories with Dropbox is a bad idea, since you can pretty easily end up with a corrupt and non-recoverable repository. Use GitHub/BitBucket to share your repositories across multiple machines.
Upvotes: 2