K
K
KerVitarLaeda2018-04-14 22:11:28
git
KerVitarLaeda, 2018-04-14 22:11:28

How to synchronize a repository through cloud storages (Google Drive, Dropbox, etc)?

One developer uses multiple machines. Going from one to another, you need to have an up-to-date project working directory. The project is contained in the repository (hg, but relevant for any vcs). Committing to a remote repository just to move to another machine is inconvenient. I just want to sit down and get on with my work.
It seems that you can just put the project in any cloud drive (Google drive, dropbox, etc) and the problem is solved. But I heard that in such a scenario, hg starts to fail due to the influence of the synchronization of the repository service files that it does not control. A colleague uses this script and sometimes the repository hangs with strange errors.
You can exclude the folder with the .hg repository from synchronization via the cloud and synchronize only the working directory. But there's a problem:
* make some new commits, publish to the "master" repository
* make more changes in the working directory,
* move to another machine
* the working directory of the repository is already updated - all changes are present
* pull new commits from the "master" repository
How now to explain to the repository that in the working directory there is already an up-to-date version on "this commit" + some other uncommitted changes ???
If we just do an update, then we will lose uncommitted changes.
Perhaps I do not know the banal hg command.
Perhaps you need to somehow properly "cook" hg in conjunction with cloud synchronization.
Please share your solution to the problem.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
G
GavriKos, 2018-04-14
@GavriKos

The correct answer is none. Synchronize the repository via a remote server with this very repository. And do not invent yourself hemorrhoids.

S
spaceatmoon, 2018-04-14
@spaceatmoon

I read some nonsense. I work on different computers and in my life I would not think of using it to store a file on cloud drives. I don't understand their role at all, plus they are slow.
Look now your dad will show you the secret technique of using the git.
1. git fetch
2. git pull
3.git push

A
Armenian Radio, 2018-04-14
@gbg

Considering that with each commit, the folder with the repository database notably shakes up, you risk spending tens of minutes synchronizing using cloud disks, while sending diffs when synchronizing with a turnip will take seconds.

T
tikhenko, 2018-04-18
@tikhenko

You should distinguish between the source directory and the repository directory.
We keep the source directory in Dropbox. We create the repository directory on each machine outside of Dropbox, inside we put a symbolic link to the source directory (on Windows it is mklink /j).
For example:

cd my_repo
mklink /j src /path/to/Dropbox/my_src

The source directory is automatically synchronized on each machine, commit from the repository directory.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question