tweetysat
tweetysat

Reputation: 2403

Using smartgit behind a proxy

I'm working behind a company proxy (with credentials) for internet access and I'd like to reach a git repository hosted outside with smartgit for windows.

My repository is hosted mygit.be, my proxy is at 10.30.30.30 on port 8080 with user toto and mygit.be is accessible via ssh on port 25000 with user git and private key authentication.

After lot of searches on internet, I added a HOME environment variable pointing to c:\Users\toto\. I also copied my private key in c:\Users\toto\.ssh. And finally, I created a config file in c:\Users\toto\.ssh containing

Host mygit.be
  ProxyCommand connect -H [email protected]:8080 %h 25000
  IdentityFile ~/.ssh/id_rsa_git

Now using

c:\Program Files\SmartGit\git\bin\git.exe ls-remote ssh://[email protected]:25000/~/myrepository.git refs/heads/*

is working fine. It's asking me the proxy password then gives me the result.

Enter proxy authentication password for [email protected]:
b21e99487808231c992d50ca6bef483bea788708        refs/heads/dev
5021a3be4be18dbdb80f6ce2a01a7ca780862c30        refs/heads/master

My problem is now to have all that working within smartgit.

I configured it to use system ssh. But on the clone dialog, after the first 'Next' button, it hangs on Checking connection to repository without never asking me the proxy password.

So, what's the solution ?

Upvotes: 0

Views: 2878

Answers (1)

tweetysat
tweetysat

Reputation: 2403

So the solution is quite simple.

First solution

It is needed to add a SSH_ASKPASS environment variable containing

git gui--askpass

Now smartgit will ask for the proxy password.

The only remaining is problem is that smartgit will ask very often the password.

Second solution

Create a dos batch file passwd.bat containing

@echo mypassword

then back to solution one and the SSH_ASKPASS vairiable now contains

path-to-bat-file\passwd.bat

Upvotes: 1

Related Questions