Reputation: 8115
Ever since reinstalling my office machine I have a problem with using TortoiseGit to access (and particularly push) to our remote server.
In my company the central repo is maintained on a remote server. On my Windows 10 PC I have Cygwin, Git and TortoiseGit installed. I also have access to a remote Linux account.
A while back I generated my public and private SSH keys and used them since then. I regularly use the Cygwin terminal (bash) to access the remote repo, and usually use TortoiseGit to manage the commits and examine logs. In the past I was able to use TortoiseGit for accessing the remote repo as well but now I cannot make it to work.
When I configure the client's Git/Remote pane to use the HTTP URL I can clone a repo. When I use the GIT URL I am asked to provide the password to the remote server. I cannot push with neither URLs.
I am using the id_rsa.pub
key from Cygwin's home/.ssh
directory in the Putty Key field (tried also the private key id_rsa
). Also, in the Network pane I set the SSH client to C:\Program Files\Git\usr\bin\ssh.exe
.
So, since my bash flow works just fine, I assume something is wrong with my TortoiseGit settings. Any idea what I am missing?
Upvotes: 1
Views: 4937
Reputation: 33993
You are mixing several things here: Git for Windows, Cygwin and OpenSSH and PuTTY.
You have an OpenSSH key, so you can't use PuTTY with TortoiseGit or enter a OpenSSH key in the PuTTY key
-field. (You already seem to have configured ssh.exe, so that's fine - or you have to convert your OpenSSH key to a PuTTY key, cf. https://stackoverflow.com/a/32115724/3906760 in order to use TortoiseGitPLink).
You seem to have Git for Windows installed as you have selected the shipped ssh.exe
from that package. This might cause an incompatibility. Just select ssh.exe
for the ssh client to make sure the ssh.exe
from the corresponding git installation is used.
It is unclear to me which git.exe
is used in TortoiseGit, I assume Git for Windows is used as this is recommended for TortoiseGit. Here, I assume the problem you face is that Git for Windows uses a different %HOME%
compared to your Cygwin environment. To fix this either copy your .ssh
folder to your Windows home directory or explicitly define %HOM%E
to point to your Cygwin home.
Btw. Cygwin Git is not recommended as it is broken - it does not pass all the Git tests of the Git testsuite (cf. https://stackoverflow.com/a/32427897/3906760).
TLDR: Use ssh.exe
as SSH client, make sure the correct git.exe
is used and that your .ssh
-folder is in the correct %HOME%
.
Upvotes: 2