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.
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- What is the tortoisehg gui equivalent of doing “hg
- How to use Mercurial from Visual Studio 2010?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is it possible to do a “destroy history” in TFS?
- Is there a version control system abstraction for
What I did to fix this (windows):
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.
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/
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://USERNAME@github.com /user:USERNAME /pass:PASSWORD
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:
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:git@github.com:githubAccount/repoName.git
The new one that did not work had an
https
address.Please see screenshot below as well.
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 likePageant 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.