When I type git pull from command line, I can get the code without any problems.
When I open SourceTree for Windows, and try a Pull, I get:
git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Completed with errors, see above.
What might I be doing wrong?
It seems like using SourceTree on windows you have to use Putty Agent. OpenSSH keys do not work.
If you have only OpenSSH key:
You now have PPK file containing your key.
In Source Tree Launch SSH Agent from tools menu and browse to your PPK file.
All operations should now work fine.
This works if you authenticate using a public/private key pair:
Open Sourcetree and go to "Tools > Create or Import SSH Keys" (this will open a PuTTY Key Generator window) and click on "Generate".
Once generated go to drupal.org and navigate to "My account > Profile > SSH Keys" and click "Add a public key".
Copy the generated public key from the "PuTTY Key Generator" window ("Public key for pasting into OpenSSH authorized_keys file:") to drupal.org and save it.
In the "PuTTY Key Generator" window enter a "Key passphrase" and "Confirm passphrase" and click "Save private key". Make sure to save it somwhere where you can find it again.
Close the "PuTTY Key Generator" window and in SourceTree go to "Tools > Launch SSH Agent (Pageant)". You should be able to select your private key file here. (the one you just saved)
Add your repository with the link provided by drupal.org. ([email protected]:project/your_project.git)
You don't need to use Putty in Windows but it is recommended, otherwise you'll have to re-add your ssh key every time you start SourceTree.
To do this go to 'Tools -> Add SSH Key...' and select the key that you provided in your cloud server (Git, BitBucket...). Now you'll be able to push/pull correctly provided you cloned your repository using the ssh url.
Keep in mind that this may apply to you only if you can successfully push/pull from the command line, if you don't then you have some other kind of problem.
If you accidentally cloned your repository using the https url then:
git remote set-url <remote> <ssh-uri>
Like:
git remote set-url origin [email protected]...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With