Running Windows 8.1 64-bit with the following installed:
- Git for Bash (v2.24.1.windows.2) using MinGW-W64
- Visual Studio Code (v1.41.1)
My personal SSH key (located at %USERPROFILE%\.ssh
) has been generated and added to my GitHub account. .bashrc
located at %USERPROFILE
has been modified to add these lines:
# Start ssh-agent to allow git to be used
eval `ssh-agent -s`
ssh-add ~/.ssh/id_rsa_personal
I start Git Bash (MINGW64) in a git repo. Now make changes to a file, git add
, git commit
and git push
the changes to my git repo...and it works fine!
For the standard Windows command prompt, I've created a file called bashrc.cmd
with this code:
rem Start ssh-agent to use git from the Windows command line
set GIT_PATH=C:\Program Files\Git
call "%GIT_PATH%\cmd\start-ssh-agent.cmd"
call "%GIT_PATH%\usr\bin\ssh-add.exe" "%USERPROFILE%\.ssh\id_rsa_personal"
Now, a new REG_SZ
value called AutoRun
in the key HKLM\SOFTWARE\Microsoft\Command Processor
was created which points to the above file (bashrc.cmd
)
Start a command prompt, and now ssh-agent
is started and my identity is added. As with Git Bash, add
, commit
and push
work perfectly. Awesome!
Now I load Visual Studio Code in my git repo. In the lower left, Code knows I'm inside a git repo:
Using the in-built Terminal in Code, I can add
, commit
and push
changes to my git repo. Great!
But now I try it with the user interface buttons. I can stage and commit changes and confirm in a separate command line windows using git status
that these work as expected. But when I use the Push
command, I get this error:
Return to the Code Terminal, or a Windows command prompt, or Git Bash, issue the command git push
and the changes are sent to the remote repo correctly.
Why is this not working with the Code Push
command?