I have two servers, A and B. A has the repo and can ssh to B. B is a new server I want to have the repo, but cannot ssh to A. I've tried copying the repo, create a remote to push, git clone with a -u... any suggestions?
A:
One way which'll set B up as a remote to A, would be to install gitosis on B and then push the repo from A to B.
For more on gitosis, see http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way. If you're using git but not gitosis, you're missing out!
Graham Perks
2010-10-21 01:16:18
Thanks, I'll take a look at gitosis and see what I'm missing out on.
2010-10-21 14:38:04
I installed gitosis and was able to push the repo to the external server. Thanks!
2010-10-21 16:16:06
A:
What do you mean when you say you've tried copying? Have you tried using scp
like so?
scp -R path/to/repo/on/A user@B:desired/path/to/repo/on/B
Note that the path following :
is relative to the user's home directory unless it begins with a /
.
Jeremy W. Sherman
2010-10-21 02:15:44
+1
A:
Create empty repository on B
B$ git init --bare repo.git
then push to it from A using SSH protocol
A$ git push ssh://B/full/path/to/repo.git
Jakub Narębski
2010-10-21 10:10:29
Hm so I tried this...B$ git init --bare externalA$ git push ssh://user@B/full/path/to/repo.gitI get that these messages:No refs in common and none specified; doing nothing.Perhaps you should specify a branch such as 'master'.fatal: The remote end hung up unexpectedly
2010-10-21 14:40:56
@user481826: I am sorry, I mixed up simpler to use but more complicated to set-up approach where you create "remote" configuration for pushing from A to B with URL-based config-less approach, where you have to specify branch(es) to push, or use `--all`/`--mirror`.
Jakub Narębski
2010-10-21 16:52:27