2

I was wondering what ways are are there to sync web projects initialized with git and mysql databases between 2 computers without using a 3rd one as a "server".

I already know that I could use a service like Dropbox and sync data with it, but I don't what to do it so.

Alex
  • 7,538
  • 23
  • 84
  • 152

2 Answers2

1

If the two servers aren't always available (in particular not available at the same time), then you need an external third-party source for your synchronization.

One solution for git repo is to use git bundle which allows to create a kind of "bare repo" in one file.
Having only one file to move around make it any sync operation easier to do.

You will have to copy a bundle from one server to another (by whatever mean you want), in order for the second repo (on the second server) to pull from (you can pull from a git bundle: it acts as a bare repo) that bundle.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

Just clone from one to the other. In git, there is no real difference between server repos and local repos in terms of pulling and cloning. Pushing from one to the other is tricky if neither is created as bare. Generally in that case, rather than push one from the other, we'll pull back and forth as needed.

tpg2114
  • 14,112
  • 6
  • 42
  • 57
  • This is what I don't get, do I have to share the folders in the network and then clone from desktop to laptop, or what? Because the computers are not always on on the same time. – Alex Feb 24 '12 at 12:42