First off, I'd like to emphasize that this question is NOT about hosting my central repo on Dropbox, and that I'm fairly new to using git. None of the other questions involving Dropbox and git that I could find really answer my question; they're all either about hosting your repository with Dropbox or whether or not it's a "good idea" to use the two in conjunction, neither of which is what I'm asking about here.
My question is as follows: I have two computers, each dual-booting Windows and Ubuntu (a laptop and a desktop). I've got my local git repository (cloned from a github repo) located in a Dropbox folder so that it is synced across machines and operating systems. When I make a commit on one machine/operating system, it doesn't seem to be syncing the commit status properly to the other machines.
e.g.:
On my Windows desktop, I make a change to foo.cpp. I then 'git commit -a' and 'git push', pushing my changes to the github hosted repository. The changes to the files are also synced across my Dropbox folder, and when I log into my Windows laptop at school, everything is downloaded without issue. However, when I type 'git status', it says:
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: foo.cpp
#
no changes added to commit (use "git add" and/or "git commit -a")
But I've already committed these changes on my other machine in, ostensibly, the same working directory. An attempt to 'git pull' from the github servers gives me the message that everything is 'Already up to date.'
I would have hoped that the repository status would be seamlessly synchronized by Dropbox. Is anybody familiar with a way around this situation? Thanks!
Don't use Dropbox for concurrent operations with Git.
Dropbox gives you eventual consistency. Using it as a backing store for critical Git operations is a Bad Idea™. It's even worse if you're using it as a working tree rather than as a bare repository. You can certainly do it, but you need to grok the limitations of this approach.
Dropbox and Spideroak Hive are fine if you want to use synced directories as a working tree for one user at a time. Just make sure that your files and folders are fully-synced before accessing them from another system. As long as you stick to a single-user, single-system workflow you shouldn't run into trouble, but your mileage may vary.
You may also run into problems if you're using multiple machines that don't agree on the time. If you aren't running NTP, one machine's clock could be ahead or behind of the other. This can lead to situations where the syncing service thinks a new file is in fact an older file (or vice-versa). In short, anything relying on timestamps may be error prone.
The accuracy of the timestamps are especially important if you are using GNU make or other tools that rely on them. If you're going to use Dropbox to synchronize a working tree, make sure your timekeeping is accurate across all systems that will touch that tree.