I have: local, server1, server2.
I have Git repository on server2. But I can\'t connect with it. I can connect to server1 with SSH and then connect to server2 with S
Have a look at ssh's ProxyCommand. By adding a section into your ssh config file like
Host server2
ProxyCommand ssh -q server1 nc -q0 %h 22
you should be able to use git with a repo an server2. Note: This requires nc being available on server1.
This solution makes accessing server2 through ssh, e.g. with git, transparent as if it was directly accessible.