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.

On the SAME clone of the repo, what is TortoiseGit doing and what is Git GUI doing?
–
manojldsJan 13 '12 at 9:15

2

When you right click for Tortoise Git, click Settings. At Git, there is a link -> Remote, click it. From remote list click origin. At right you will see URL. Instead of your username at URL wright that: username:<your password>. Finally when you make a git operation from Tortoise Git you will see that it never asks you about password.
–
kamaciJan 5 '13 at 16:55

1

Are you using the http URI instead of SSH? That was my problem
–
CAD blokeJan 31 '13 at 11:09

For the "special ones" amongst us (me included) remember to remove the 'git clone' bit from the front of the command before pasting it into the URL window of the Tortoise Git Clone window - otherwise you get similar issues
–
icc97Jun 17 '13 at 12:21

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

Open windows command prompt in a same directory where you downloaded your plink.exe

Run this command: plink -v <path_to_your_git_clone_repo_link>

Look at the output and see if you have line like Reading private key file "C:\Path\To\Some\privateKey.ppk"

If you see line like this, and it is not putty key file you want to use then just go and rename/delete/move that file so that plink cant load it next time

After you renamed problematic file it should all work as expected, if you run command from point 3. you should see that plink now cant load that ppk file and after that it should output something like Pageant is running. Requesting keys. and we actually wanted this

That 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.

generate a keypair using PuttyGen, (or import into .ppk if you
already have a key)

load the private key to peagent

import public key to you gitosis server (supply your public key to your admin)

and then use plink as SSH client

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.

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.

it works just nice, but is there a way to encrypt the plain password ? I felt uncomfortable storing my github password in plain text file.
–
Dio PhungJun 4 '14 at 15:42

@DioPhung Think about what you just said. If the password is encrypted, you'd now need to remember a (new) password for using the password. If you don't have to remember the password, then it's as good as not having a password (from a local threat perspective). Either you want convenience or safety.
–
Camilo MartinAug 10 '14 at 4:49

@CamiloMartin: My concern is if my PC is shared with some other users and some of them are administrators, then they can see my password which stored in plain text inside _netrc file. Sorry I lost you at ` If the password is encrypted, you'd now need to remember a (new) password for using the password.` , can't I hash the password using itself ?
–
Dio PhungAug 11 '14 at 3:08

1

@DioPhung If you are afraid of local administrators, they can easily install a keylogger. A local administrator can do whatever he/she wants with your data, and as such, any security against them would be security through obscurity (even tools and tricks that banks use can't protect you against a knowledgeable and determined local administrator, and they do try hard). Regarding hash, what do you mean? A hash is non-reversible. And if you encrypt using the password itself, you'll still need to type it every time... So it's the same as not encrypting it in the first place.
–
Camilo MartinAug 11 '14 at 8:09

@DioPhung On a hopefully more helpful note to your particular situation, you may want to look here, and also ask about BYOD possibilities if you have a laptop.
–
Camilo MartinAug 11 '14 at 8:11

it works for me with tortoise version 1.8.3... this problem maked me crazy!! on windowsXP@32 bit tortoisegit works only with c:\programmi\git\bin\ssh.exe on Windows7@64 it works well with toirtoiseplink.exe (default)
–
EvilripperMay 31 '13 at 10:25

On my Windows 8 machine, pointing the SSH client to the msysGit ssh.exe file worked when the password query didn't show up at all. A different problem but this solution is definitely worth a try for someone experiencing ssh problems with TortoiseGit
–
IcermannAug 19 '13 at 18:39

use plink with peagent, see my answer below. hopefully it works with win8 as well
–
mzzzzbSep 3 '13 at 17:19

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.