You should use git init --bare in the Dropbox folder. Bare repositories have no working tree for editing, but still support git operations that don't need a working tree.
I'm actually doing this for scripts and configuration I share between my work and home PC, because it would be too annoying to constantly keep them synced over github or something.
When I was using Wuala or Spideroak, their bad scheduling (no priorization of small files like Dropbox does, overall slow sync) and conflict resolution would constantly screw up the repository.
With Dropbox I never have this problem; The small files that are involved in these repositories are usually synced instantly.
Again though, I am talking about configuration and scripts. The kind of "project", where the git repository is really only a linear history of previous states in case I mess something up and want to reset to a working state.
I also have to work on 2 machines, my office workstation and then laptop when WFH. On top of that all the code has to run on the office workstation (data and multi-GPU requirements). I find VS code very good for that, I just open an ssh session and edit the code through my laptop but directly on the remote workstation. Maybe it's something that would be useful for you too?
For WFH scenarios, I just remote into the remote device, because I anyway cannot store stuff relating to industry partners on my private device.
I am talking more about helper scripts, that have grown over the time of my masters and PhD, that I use locally on both devices (like wrappers around imagemagick for enhancing scans). I need those scripts on both devices, always in the latest version, and don't want to bother doing a pull before using them.
Why is it more annoying to start every day with git fetch and git pull and end it with git add ., git commit, git push than using drop box? Does dropbox has a cli or how does your local changes sync to drop box?
It would be easy, if all of those were a single repository. But even then, you'd actually have to manually do so, while Dropbox just works automatically in the background. There is no "oops, forgot to push at the other PC".
1.1k
u/Maskdask Oct 21 '22
I tried this but Dropbox starts fucking around with your files when you switch branches and such.