简体   繁体   中英

Git SSH in RStudio works using the GUI button, but not using shell

I have an RStudio project connected to a GitHub repository. I'm using SSH authentication and I can commit, push/pull using RStudio's GUI with no problem. However, when I try pushing using the shell by eg git push or git push -u origin master I get an error

Could not create directory 'c/Users/<user>/<path>/<reponame>/=/.ssh'

I have checked many related questions, but none of them seems to solve this issue. How come the gui push button achieves the desired result, while the above code fails? If I change authentication to https, I can push/pull using the shell, so it is clear that it has something to do with ssh.

I'm on Win10, using RStudio 1.1.383 and Git 2.8.3.windows.1.

Any ideas?

Check your git config -l for any SSH related setting.
Check also your environment variable (type 'set' in a CMD, or env in a git bash). I would double-check the value of %HOME% or $HOME in your bash session.

I suspect a variable or configuration with an incorrect value, including an ' = ' in it.

As seen in the comments:

set HOME=%USERPROFILE% changed the HOME path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM