Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSH - ksh: git: not found

Tags:

git

bash

ssh

ksh

I have GIT running on a Solaris server.

From a windows machine I installed cygwin to try to clone a repository hosted on the server.

I do the following:

$ git clone username@server:project.git
ksh: git-upload-pack: not found

So I try

$ ssh username@server echo \$PATH
/usr/bin

It seems like git is not in /usr/bin/ but in /usr/local/bin/. I tried changing the PATH in .bashrc on my home directory on the server to add /usr/local/bin/ ... but it doesn't seem to work.

What am I doing wrong ?

like image 992
ddallala Avatar asked Dec 07 '22 05:12

ddallala


2 Answers

~/.bashrc is read by non-login shells, but only by bash, and your server uses ksh.
~/.profile is (I think) universal initialization file, but it is read only by login shells.
~/.kshrc is typical startup file read by ksh, but only if ENV environmental variable is set to it (but see SendEnv in ssh_config manpage).


Also you can always pass --upload-pack=/usr/local/bin/git-upload-pack option to "git clone" (and then set remote.origin.uploadpack configuration variable) if you can't set PATH on remote. And of course remote.origin.receivepack if it can't find git-receive-pack.

like image 115
Jakub Narębski Avatar answered Dec 09 '22 19:12

Jakub Narębski


Sounds like your shell on the Solaris machine is ksh and not bash, which is why your .bashrc isn't being read. Try putting the change in .profile

like image 34
NUXI Avatar answered Dec 09 '22 18:12

NUXI