Reputation: 6270
I just started to work on Git. I use windows 7 and has installed msysgit(1.7.8) and Tortoisegit(1.7.6). The repository is created on Linux server which is accessible thru LAN. The issue I'm facing is I'm not able to clone the repository using Tortoisegit, it asks for password and I'm not sure what password it is asking. At the same time I could clone the repository using Git Gui and do all operations. Can anybody please help me on understanding why Tortoisegit is asking password when Git Gui doesn't. I tried uninstalling Git and Tortoisegit and then install again but no success.
Upvotes: 94
Views: 118572
Reputation: 328
What ultimately helped me, (after unsuccessfully trying other answers), was to input C:\Program Files\Git\usr\bin\ssh-pageant.exe
(not ssh.exe) in the TortoiseGit SSH client.
You can find the setting at TortoiseGit -> Settings -> Network -> SSH client
Upvotes: 0
Reputation: 6270
My colleague solved the problem. Steps:
C:\Program Files\TortoiseGit\bin\TortoisePlink.exe
C:\Program Files (x86)\Git\bin\ssh.exe
Alternatively:
C:\Users\...\AppData\Local\Programs\Git\usr\bin\ssh.exe
C:\Program Files\Git\usr\bin\ssh.exe
- with Git 2.37.3Upvotes: 158
Reputation: 11
Uninstall Tortoisegit app Do fresh install
Next
, until Finish
Finish
Now your Tortoise is not asking for "login as"
Upvotes: 0
Reputation: 1572
I just face a similar problem today and was able to fix it installing the latest version of git from https://git-scm.com/download/win
Upvotes: 2
Reputation: 4282
What I did to fix this (windows):
Upvotes: 3
Reputation: 185
Had the same problem. In my case there was no password I could enter there. The connection was configured as SSH but there were no keys defined for repo.
Check out: TortoiseGIT SSH configuration. Those instructions are for cloudforge, but for other services you have to do the same, just provide your public key to your git repository provider.
Upvotes: 1
Reputation: 1703
I had the same issue. My environment is windows 10 with TortoiseGit 2.3.0.0 and git version 2.11.0.windows.1
The following solved my problem:
Upvotes: 9
Reputation: 101
Tortoise GIT DOS command line stopped asking for my password once I placed my private and public keys in C:\Users\.ssh dir. I am on Windows 7.
Upvotes: 2
Reputation: 25725
Please not the URL of the repo remote origin can cause this problem. I had an old repo that worked perfectly and a new one I just cloned that was asking me for password.
Upon comparing the information in Settings > Git > Remote > Url
I saw that the one which worked had:
[email protected]:githubAccount/repoName.git
The new one that did not work had an https
address.
Please see screenshot below as well.
Upvotes: 1
Reputation: 3679
Pramodtech's answer stopped working for me with the current version of the official Windows Git client. It stores the ssh executable in Git\usr\bin
instead of Git\bin
now (since version 2.5 released in Aug 2015).
So go to TortoiseGit > Settings > Network
and change the SSH client path to:
C:\Program Files\Git\usr\bin\ssh.exe
(or whatever the path to your Git installation is)
Upvotes: 2
Reputation: 85966
If you need to use a username/password, there is a much simpler solution than the current #2 answer:
Right-click --> Tortoise Git --> Settings --> Git --> Credential --> Choose "Wincred, all Windows users" --> Hit apply
The next time you enter the password for a repo, that password will be automatically saved.
If you're using a repository that requires SSH keys rather than username/password (which it sounds like was OP's original issue), you need to
Right-click --> Tortoise Git --> Settings --> Git --> Remotes
. Find your remote (usually 'origin') then load the PuTTY key from step 2.Upvotes: 47
Reputation: 289
To automate authenticating either use:
Obviously, do not store your password in a text file unless the repo is not important.
TortoiseGit >1.8.1 installs the helper git-credential-winstore which provides the local API to access and store your login info in the existing, local Windows Credential Store.
You can see the stored credentials by going to Control Panel → User Accounts → Credential Manager and choosing "Windows Credentials". The entries starting "git:" are from git-credential-winstore.
You can set up wincred per repository by:
(GUI)
(CLI, POSH)
cmdkey /add:git:https://[email protected] /user:USERNAME /pass:PASSWORD
@"
[credential]
helper = wincred
"@ | Out-File -FilePath $repoRoot\.git\config -Append
You can list all credentials stored for repos with cmdkey /list:git:*
Once stored, passwords are not displayed by cmdkey (http://ss64.com/nt/cmdkey.html)
To list all credentials with passwords you need to use the Windows API. For powershell, there's CredMan:
. .\CredMan.ps1
.\CredMan.ps1 -ShoCred
Upvotes: 5
Reputation: 356
To do it without keys...
Right click on your folder
Select tortoiseGit->settings->Git->Remote
Select origin (or whatever you have labeled your main remote)
Under URL use this format.
Https://USERNAME:PASSWORD@URL
Where
USERNAME is your username
: the colon separates username and password and must be there
PASSWORD is your password
@ separates credentials with your url
URL is the url you would use to connect to the .git resource
Thanks goes to Kamaci
Upvotes: 24
Reputation: 3541
Since non of the solutions provided here worked for me, and after a lot disappointments with solutions I found online I finally managed to fix this on my machine.
I don't know when or how I set up my TortoiseGit putty to always use one specific key, and of course this made all the problems when I tried to connect to different server with new pair of keys.
So how to fix a problem and how to tell if you actually have same problem as I had:
plink.exe
on your machine from hereplink.exe
plink -v <path_to_your_git_clone_repo_link>
Reading private key file "C:\Path\To\Some\privateKey.ppk"
ppk
file and after that it should output something like Pageant is running. Requesting keys.
and we actually wanted thisThat is it, if anyone knows how I can disable this "global default putty key" please let me know in the comments and I'll update this answer with the info.
Upvotes: 1
Reputation: 1452
One way to do this is
plink works natively with peagent to retrieve the loaded key.
you can find plink.exe along with peagent and other goodies in standard putty distribution
to use it go to:
TortoiseGit Settings -> Network -> SSH client .
by default this contains path to TortoisePlink.exe, instead of that give path to plink.exe
Alternatively you can use ssh(.exe) in msys(git) distribution but then you cannot use private key in .ppk format/Peagent combination. You either need to export your key to OpenSSH format via PuttyGen or create a keypair using ssh-keygen instead.
Upvotes: 5
Reputation: 519
Saving username and password with TortoiseGit
Saving your login details in TortoiseGit is pretty easy. Saves having to type in your username and password every time you do a pull or push.
Create a file called _netrc with the following contents:
machine github.com
login yourlogin
password yourpassword
Copy the file to C:\Users\ (or another location; this just happens to be where I’ve put it)
Go to command prompt, type setx home C:\Users\
Note: if you’re using something earlier than Windows 7, the setx command may not work for you. Use set instead and add the home environment variable to Windows using via the Advanced Settings under My Computer.
CREDIT TO: http://www.munsplace.com/blog/2012/07/27/saving-username-and-password-with-tortoisegit/
Upvotes: 15
Reputation: 4033
Unfortunately, on my machine with Windows 8 the solution with repointing SSH client didn't work. Solution that solved the problem for me is here: http://www.munsplace.com/blog/2012/07/27/saving-username-and-password-with-tortoisegit/
Upvotes: 1
Reputation: 4983
The URL and the window title TortoisePlink both indicate that tortoise are trying to use ssh as the transport protocol. git support more than one transport protocol, including file system access, and ssh access. In your question, you are describing that you want to access your remote repo by file system access. In that case your remote url should look something like file://server/path/to/repo
. Please check your remote repo URL again.
Upvotes: 3