How to use msys2 git and ssh executables for Pycharm git integration

0

I am using Pycharm 2017.1 for Python development on my Windows 7 computer. Naturally, I use the git integration plugin for maintaining a git repo of my project. I am having issues using the git executable available in msys2's package manager for this purpose. All is fine when I try to add or commit files, but when I try pushing I get an error.

cannot run ssh: no such file or directory unable to fork

If I couldn't get ssh to run, I thought I would try to change the remote url to use https instead. Then I started getting an error message about an inability to load shared libraries in git's https module.

Changing the option in the Git Integration Settings menu to use the native ssh executable instead of the built-in also did nothing.

How do I configure Pycharm to use msys2's git and ssh executable?

ktb

Posted 2017-06-18T02:37:58.210

Reputation: 133

Answers

1

The issue with the inability to find the ssh executable in 'native' mode and the inability for git's https module to load shared libraries is due to an incompletely configured environment. Instead of directly pointing to msys2's git executable, point to a script that starts the msys2 start script to set up the environment, and then calls git.

@echo off
C:\msys64\msys2_shell.cmd -defterm -no-start -here -c "git %*"

ktb

Posted 2017-06-18T02:37:58.210

Reputation: 133