Permission denied (publickey).
When using Git on the command line on Windows, you may encounter an error like this:
C:\Users\Local Administrator\Sites\devdesktop\yoursubscription-dev\docroot>git push
yoursvn-12345.prod.hosting.acquia.com: Permission denied (publickey).
fatal: Could not read from remote repository.
One way to find out which key it is using, first run this command:
git config core.sshCommand "ssh -vvv"
This tells the SSH command that Git needs to run in very, very verbose mode. This will tell you the location(s) that SSH is looking into find the public key. If your copy of Dev Desktop is able to push, then you have the correct public and private key pair installed.
To find out the location of your private key:
- Make a backup of the public and private key pair that SSH is looking at. If it doesn't exist, that's fine. The following steps will set it up in the right place.
- Go to Dev Desktop's preferences.
- Copy the location in "Private key" to your clipboard
- Run the following command in the terminal. Replace [location of your private key] with the location. Keep the quotes but lose the brackets.
git config core.sshCommand 'ssh -i "[location of your private key]"'
Git error: Invalid path 'docroot/vendor/example/example-dependency/ (in Acquia Dev Desktop)
You may have to add those files manually:
- Click the Acquia Dev Desktop terminal button.
- Run
git status
on the folder to see what files need adding. - Run
git add [path]
on each path that is not staged. - Run
git status
again to see what will be added. - Run
git commit -m "[Descriptive message here.]"
- Run
git push