0

I would like to connect to my gitlab server from home but I am getting problems. How can I do this?

Computer A <------------> Computer B <-----------------> Computer C (gitlab)

What I have so far:

  • I created a tunnel with Putty
    • (Session) Hostname: ComputerB-IP
    • (Session) Port: 22
    • (Connection/Tunnels) L3333 ComputerC-IP:22
  • I created a private key with Putty-keygen and added it to my account in gitlab

What I can do:

  • I can connect with ssh to localhost:3333 which connects me to the gitlab server (Computer C). So I think the tunnel is working.

What I can't do:

  • When I clone a git repository with TortoiseGit I use the following url: git@localhost:3333:my/repo.git I get the following error:

Cloning into 'C:\Users\xxxx\Desktop\EXCHANGE\git-repo'... fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

git did not exit cleanly (exit code 128) (3531 ms @ 5/10/2016 2:53:26 PM)

I load the private rsa key with TortoiseGit previous to the clone call...

Any ideas?

Yue Lin Ho
  • 2,479
  • 23
  • 32
nino
  • 773
  • 1
  • 11
  • 25

1 Answers1

1

Set up a putty session and configure a different port (3333) there. This cannot be done in the clone URL. Then use the session name instead of localhost.

Btw. you can also configure the tunnel within this session, so that it gets automatically set up for cloning/fetching/pulling.

See https://stackoverflow.com/a/29183147/3906760

MrTux
  • 28,370
  • 24
  • 91
  • 123