问题
I have followed the below instructions to create an SSH key and added it to Gitlab.
https://www.sourcetreeapp.com/faq/ (under the heading "How do I set up SSH keys for authentication?")
My changes are being tracked in Sourcetree and I am able to commit but I cannot pull or push without it asking for Authentication. Every time I add my password it rejects it but I am able to login direct to Gitlab with the same details. Am I missing something?
I thought having set up SSH I wouldn't have to authenticate with the username and password as well. Please see screen shot which shows I have added the SSH key to the Pageant and the authenticate box.
Can anyone help?
回答1:
It Could be a number of things:
- Has your private key been added to Sourcetree? Tools > General > SSH Client Configuration?
- Has your key been added to the SSH agent? Tools > Launch SSH agent, and is the "Automatically start SSH agent when SourceTree opens" check box ticket
- Has your private key been added to your profile on GitLab? Profile Settings > SSH Keys
- Did you clone the GitLab repo using the http link? if so you'll always need to use the details to log in, change that by cloning it with the SSH link. It will be something like git@[domain]:[group]/[project]l.git
来源:https://stackoverflow.com/questions/33416769/setting-up-ssh-on-sourcetree-wont-push-to-gitlab-asks-for-password