Msysgit git no longer finds ssh keys - windows

I have an older Windows XP laptop on which I recently upgraded git to 1.8.4.msysgit.0, in order to benefit from the new cmd\git.exe instead of the older cmd\git.cmd for scripts.
After this upgrade, git asks for a password for its operations (such as cloning), where it did not before the upgrade. None the of the ssh keys were changed in any way.
The strange thing is that both
"c:\Program Files\Git\bin\ssh.exe" user#x.x.x.x
"c:\Program Files\Git\bin\git.exe" clone user#x.x.x.x:/path/to/repo
work, but
"c:\Program Files\Git\cmd\git.exe" clone user#x.x.x.x:/path/to/repo
does not.
Background information:
I tried setting %HOME%, but this did not help.
I did the exact upgrade for a win7 computer, without problems.
%PATH% includes the cmd folder of the git installation, not the bin folder.
Update1:
After messing around a bit, I noticed the ssh command also asks for a password if the %HOME% variable is set. It was set using set HOME=%HOMEDRIVE%%HOMEPATH% which resolves to c:\Documents and Settings\username.

Old versions of msysgit apparantly kept their ssh keys in the Git installation folder (c:\Documents and Settings\username\.ssh). There were 2 files in this folder (id_rsa and id_rsa.pub) that were not present in the ssh folder in the home folder. After copying these, the problem was solved.

Related

issue with Git Bash

I am able to open git bash by typing "git bash" in the windows explorer URL space on one of my other laptop.
However, I'm trying to do it on another laptop of mine and it refuses to work. A black terminal opens for a split second and then disappears.
I've reinstalled it multiple times to no avail.
Currently using v2.27 of Git on Windows 10.
Any idea how I can get this working again? It's super convenient for me.
In system variables the C:\Program Files\Git\cmd is added to Path.
To launch git-bash.exe (which is the program which will use git.exe internally)
directly from windows explorer address field, you need to make it findable in Path.
git-bash.exe is in C:\Program Files\Git\ (notice the lack of cmd directory)

Windows 10 cannot recognize Git

I have installed Windows 10 x64 on my laptop, and then go with latest Git as well (Git-2.6.3-64-bit). As I see on my laptop, Git now is installed at this directory: C:\Users\MyPC\AppData\Local\Programs\Git (I have no chance to specify another particular folder because it's done automatically during Git installation). The options "Use Git from the Windows Command Prompt" and "Use OpenSSH" are already selected, the windows path is updated with Git dir. And after all, the problem is, Windows cannot recognize where Git is to call. I've tried git --version but it's unrecognized from Windows.
My questions are (on Windows 10 Pro x64):
1. Can we specify another installation folder for Git?
2. In Git dir/bin, there no ssh.exe, while in OpenSSH selection dialog, it tells me "This uses ssh.exe that comes with Git". So where is it, the built-tin SSH client?
3. I'm doubting that now Windows 10 doesn't accept any external program installed on %USERPROFILE%/AppData to be included to system path. Is it correct?
4. How to make Windows "see" Git?
Just solved this myself this was a very frustrating journey but for me the following got me going:
Make sure c:\Windows\System32\OpenSSH\ is in your path variables (yea I know Windows should see this on its own)
Go to C:\Users\<>.gitconfig edit your global git config file to point to the correct ssh.exe 'C:/Windows/System32/OpenSSH
Make sure your id_rsa.ppk file is in C:\Users\<>.ssh If you don't have an SSH key yet generate one and make sure it ends up in this folder
You may also want to check that your OpenSSH Authentication Agent is started in Windows Services
Can we specify another installation folder for Git?
Try running the installer as an administrator, so it can be installed to Program Files. I'm not sure how to specify a custom path.
In Git dir/bin, there no ssh.exe, while in OpenSSH selection dialog, it tells me "This uses ssh.exe that comes with Git". So where is it, the built-tin SSH client?
Some digging told me that it might live inside the .ssh folder in the Git installation, so C:\Users\MyPC\AppData\Local\Programs\Git\.ssh
I'm doubting that now Windows 10 doesn't accept any external program installed on %USERPROFILE%/AppData to be included to system path. Is it correct?
AFAIK you can add any directory to your path.
How to make Windows "see" Git?
Add C:\Users\MyPC\AppData\Local\Programs\Git to your path:
Start the System Control Panel applet (Start - Settings - Control Panel - System).
Select the Advanced tab.
Click the Environment Variables button.
Under System Variables, select Path, then click Edit.
You'll see a list of folders, as this example for my system shows: C:\Program Files\Windows Resource Kits\Tools\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Support Tools\;C:\Program Files\Common Files\Roxio Shared\DLLShared;C:\Program Files\Common Files\Ulead Systems\MPEG;C:\Program Files\Intel\DMIX;C:\Program Files\Executive Software\Diskeeper\;C:\Program Files\Bonjour\;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Misc
You can add additional folders that you want to include in searches. I add a "C:\program files\misc" entry into which I place my standalone utilities, instead of copying them into C:\windows. Click OK.
You'll need to restart the processes (e.g., command prompt) that use the system path to see the added folders.
From http://windowsitpro.com/systems-management/how-can-i-add-new-folder-my-system-path

Correct git.exe path for TortoiseGit under Git for windows 2.4

I have installed the Git for windows 2.4.1 release candidate (64bit)
It seems that after installation the following has been added to the system path
C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin
But with that setting it seems that TortoiseGit stops working. When I try to do a git operation in TortoiseGit, it cannot find my git username anymore.
I have version 1.8.14.0 of TortoiseGit, which is the latest.
The TortoiseGit Git.exe Path setting currently points to C:\Program Files\Git\cmd.
In the TortoiseGit documentation it states
There is a known issue in msysGit/Git for Windows: Git for Windows
provides two git.exe-files (one in a folder named bin and one in a
folder named cmd). Make sure Git.exe Path points to the bin-folder
within the Git for Windows installation folder.
In Git 2.4 there is a folder C:\Program Files\Git\usr\bin, but that no longer contains the git.exe binary.
The git.exe binary is found in both C:\Program Files\Git\cmd and C:\Program Files\Git\mingw64\bin but neither of those settings work for TortoiseGit.
All of these answers are wrong.
The Git.exe Path in setting is set incorrect.
Steps to fix:
Right click on git respostory
Select TottoiseGit | Settings
You will get the warning dialog
Dismiss it
You will get another dialog, select ignore
Settings will launch
Select: General (at the top of the tree)
In the edit field for Git.exe path (half way down) enter the Git.exe path
(in my case C:\ProgramFiles\Git\bin)
That's it!
Check to make sure that your %HOME% variable in Windows is set so that TortoiseGit can find your .gitconfig file.
TortoiseGit 1.8.14.1 (preview release) has full support for Git for Windows 2.x (no need for workarounds with adding unneeded folders to %PATH%). Before this version, TortoiseGit cannot find the git system config of Git for Windows 2.x.
The warning you are getting means that you haven't set up the user.name and user.email git config settings. This can be done for a project or also globally (in %HOME%\.gitconfig: TortoiseGit here uses the %HOME% environment variable - if it is not set TortoiseGit uses your Windows home directory automatically).
I was also getting the same error. I installed git from here. And then tried to install tortoisegit, it worked.

SourceTree 1.6.14 cannot find Git 2.4.0 installation on Windows

After installing Git 2.4.0 on my Windows 7 system, I tried to change the option in SourceTree 1.6.14 to "Use System Git", rather than the embedded version.
However, upon clicking "Use System Git", nothing happened and the setting remained set to "Use Embedded Git".
How can I make SourceTree use the installed version of Git?
This will be probably fixed in a future patch for SourceTree, however, until it does there is a workaround as follows.
Git versions prior to 2.0 stored git.exe in a subdirectory called bin and this is what SourceTree is looking for. As of Git >=2.0, git.exe moved into a folder named cmd.
Therefore, the easiest way to get SourceTree to recognise your Git installation, is to create a symbolic link for the folder using mklink as follows:
C:\Program Files (x86)\Git\>mklink /D bin cmd
Edit:
Whilst the above fixes Git for the normal GUI operations (commit/push etc.) it does not fix the "Terminal" button, as this command tries to execute sh.exe via the following command and fails as sh.exe has also been moved in Git 2.4.
"C:\Windows\System32\cmd.exe" /c "C:\Program Files (x86)\Git\bin\sh.exe" --login -i
Edit 2: Further reading - this was raised as an issue by the Git for Windows maintainers here.

Changing my mind about the PATH when setting up Git for Windows

I have Git on my Windows 7 computer, and when I set it up, I chose Git Bash only, to be safe. Now, I want to install Aptana Studio 3, and one of the requirements is that I have Git, with the ability to use Git from the command line, which I understand is not the case now. How can I go back and change that setting?
Have you tried reinstalling Git? Many windows installers support the concept of reinstalling, allowing you to pick your installation options again.
If that doesn't work, I'd suggest uninstall/reinstall.
You can just edit the system PATH environment variable to include c:\Program Files\Git\cmd or wherever you installed Git to. The git.cmd and gitk.cmd batch scripts setup the right environment and that is all the installer does for you.

Resources