Question

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 ?

Was it helpful?

Solution

~/.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.

OTHER TIPS

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

I had to add /usr/local/bin to my path in .profile for it to be picked up on solaris (and get git upload-pack to work). I always thought it was my boxes that were badly configured, but maybe not so...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top