Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ccmijudeveloper's avatar

Problem with Homestead and VSCode Source Control menu

Hello,

Im having troubles to pull, fetch or push to my github repo from VSCode Sorce Control menu. Im able to connect and push using the virtual machine terminal but no using the source control menu.

I installed Homestead from github repo, and pput this code on my homestead.yaml:

ip: "192.168.130.10"
memory: 2048
cpus: 2
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa


#folders:
    #- map: ~/code
      #to: /home/vagrant/code

sites:
    - map: curso-laravel.des
      to: /var/www/html/curso-laravel/public

databases:
    - homestead

Its my first time with Homestead, I always use a Debian virtual machine to do my work with Laravel.

When I use the pull option from Source Control menu in VSCode it shows me this error:

Git: [email protected]: Permission denied (publickey)

And this is the git log error:

2023-12-26 10:07:15.999 [info] > git status -z -uall [4ms] 2023-12-26 10:09:43.185 [info] > git log --oneline --cherry main...main@{upstream} -- [2ms] 2023-12-26 10:09:44.049 [info] > git pull --tags origin main [859ms] 2023-12-26 10:09:44.050 [info] [email protected]: Permission denied (publickey). fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists. 2023-12-26 10:09:44.087 [info] > git config --get commit.template [15ms] 2023-12-26 10:09:44.090 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/main refs/remotes/main [7ms] 2023-12-26 10:09:44.105 [info] > git status -z -uall [6ms]

As I said, I can do git push origin main from the VSCode terminal, so the problem is Source Control is not looking to my correct ssh key storage. This is my c:\Users\user.ssh\config file: Host curso-laravel HostName 192.168.130.10 User vagrant #IdentityFile ~/.ssh/id_rsa

It doesnt work uncomment the IdentityFile line even.

this command ssh -vT [email protected] allows me to enter my passphrase and successfully connect to github.

What can I do to solve this?

0 likes
0 replies

Please or to participate in this conversation.