GitHub SSH authentication doesn't work in terminal tab, but it does if I click the "Push" button (Windows 10)

I would like to do all my github workflow in the Terminal tab on RStudio in Windows 10. I have SSH authentication set up. I can do everything except git push from the Terminal tab because the SSH authentication fails (Permission denied publickey). But I have set up the SSH keys correctly, and it works fine if I click the "Push" button in the Git tab. There, the "Push" button executes the command C:/Program Files/Git/bin/git.exe push origin HEAD:refs/heads/main. So I think the reason is that in the Terminal tab, git push is using the wrong git executable, because if I enter which git in the Terminal tab, that is running Git Bash, I get /mingw64/bin/git. My question is how do I configure the Terminal tab to use the correct git executable by default, so that I can push from there?

To answer my own question, I did not need to change the location of the executable in git bash. I just needed to run ssh-keygen in the git bash terminal window within RStudio to create a separate SSH key for that version of git and register it on github.com.

1 Like

Hi,

You can change the default terminal bash under 'Tools --> General options --> Terminal'. You can then use the Windows one and it should work.

PJ

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.