Main Area and Open Discussion > General Software Discussion
DVCS ? (All about Git, Mercurial-Hg and the like...)
Armando:
if A and B are on a network, you can directly pull to A from B and conversely.
wraith808:
if A and B are on a network, you can directly pull to A from B and conversely.
-Armando (June 07, 2011, 09:35 AM)
--- End quote ---
So how do I do that? I didn't see anything about it on any of the reference that I saw, though I might have just missed it. Can you point me to something that shows how to do that? I think I see the light... but I just can't figure out whether it's the end of the tunnel or a train...
Armando:
I haven't tried it (not my current setup) and I know some here are much more knowledgeable than me. But I gues it would go like that :
1- initialize "yourproject" repo in A and track all files. In your directory:
cd "your directory"
git init
git add *.*
2- in B, create a directory and clone the A repo:
cd "your directory in B"
git clone -l --no-hardlinks "path to your repo in A"
3- in B, add a reference to A:
git remote add "name you want to give to this remote" "path to your repo in A"
4- in A, add a reference to B :
cd "your directory in A"
git remote add "name you want to give to this remote" "path to your repo in B"
Now from A or B, you can pull changes :
cd "your directory in A"
git pull "path to your repo in B"
OR
cd "your directory in B"
git pull "path to your repo in A"
[EDIT : you might want to do a "git fetch" and then a "git diff" followed y a "git merge", rather than a "git pull", that way you can review what you're bringing in.
git fetch doesn’t touch your working tree at all but "pull" will.]
Armando:
Just took 15 min to try it (to make sure...) and it seems to work well -- at least with the command line. (P.S.:Using "Pull" rather than "fetch" + "diff" + "merge" for such a setup seems more straight forward.)
wraith808:
Thanks for your help with this. I'm going to try to set it up tomorrow.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version