tags:

views:

623

answers:

3

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 ?

A: 

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

krosenvold
Agreed, just caught that - the .bashrc is most likely not being sourced by the non-interactive git login.
Jefromi
+3  A: 

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

NUXI
+2  A: 

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

Jakub Narębski
I was not able to set the PATH using .profile, so I tried your method and it worked perfectly. Small modification, had to do: git config remote.origin.receivepack /usr/local/bin/git-receive-pack
vinnybozz
Thx for the help Jakub. Sorry, I accidentally removed my vote and it tells me 'Vote too old to be changed, unless this answer is edited'
vinnybozz