Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git Push failed: Failed with error: ssh variant 'simple' does not support setting port

My git remote origin uses ssh url with port specified. I am getting an error while pushing using IntelliJ.

Push failed: Failed with error: ssh variant 'simple' does not support setting port

I encountered this error after upgrading to latest git 2.16.1

Push failed: Failed with error: ssh variant 'simple' does not support setting port

like image 622
TheKojuEffect Avatar asked Jan 24 '18 04:01

TheKojuEffect


3 Answers

From https://confluence.atlassian.com/bamkb/unable-to-detect-latest-git-changes-ssh-variant-simple-does-not-support-setting-port-943532118.html, it seems like git 2.16 doesn't work with SSH executable bundled with IntelliJ 2017.3.

Git version 2.16.0-rc0 does not work well with OpenSSH version 6.7 or older as stated in this bug report.

Changing IntelliJ configuration to use "SSH Executable -> Native" fixed this issue.

Git Executable to Native

like image 101
TheKojuEffect Avatar answered Oct 18 '22 23:10

TheKojuEffect


I got it solved with setting

git config --global ssh.variant ssh

No need to change anything in Android Studio 3.1

like image 20
fanky10 Avatar answered Oct 19 '22 00:10

fanky10


Applies to:

  • Windows 7
  • IntelliJ Idea 2017.3.4 Build UI-173.4548.28 build on Jan 29, 2018
  • git version 2.16.2.windows.1
  • ssh -V OpenSSH_7.6p1, OpenSSL 1.0.2n 7 Dec 2017

1) IntelliJ IDEA remove port number from your remote

before: | origin | ssh://[email protected]:24567/ABC/my.project/project|

after: | origin | ssh://[email protected]/ABC/my.project/project|

2) IntelliJ IDEA leave SSH executable as "Build-in"

3) create ssh config file ~/.ssh/config

Host git.mycompany.com
  HostName git.mycompany.com
  Port 24567
  User myusername

more details about config see: https://www.ssh.com/ssh/config/

4) restart IntelliJ IDEA

like image 3
Denis Udod Avatar answered Oct 18 '22 22:10

Denis Udod