I have access to server A via ssh, and from server A can access server B, which runs gitlabs and contains the repository I need access to. When I am ssh'd into server A, I can run
git clone http://serverB/path/to/repo.git successfully. Using
git:// instead of
http:// does not work. (Errors are "does not appear to be a git repository" and "unable to connect to serverB," respectively.)
If I set up a tunnel like this:
ssh username@serverA -L 3333:serverB:80 -N
The following two attempts at git clones fail:
git clone http://localhost:3333/path/to/repo.git
Fails with: "fatal: repository not found"
git clone localhost:3333/path/to/repo.git
Prompts me for my password for serverB, and then fails with "fatal: 3333/path/to/repo.git does not appear to be a git repository." Of course, it isn't! My attempt at specifying localhost, port 3333, is clearly being interpreted as a relative path on serverB.
Is there a way to fix this? Is something fundamentally wrong with this approach?