I\'ve read this answer about eight-five times, but there\'s something I\'m not understanding correctly:
git-upload-pack: command not found, how to fix this correctly
This is connected to this issue:
https://serverfault.com/questions/130834/svnssh-getting-bash-to-load-my-path-over-ssh
Ssh is not loading your environment by default when sending a command without going to interactive mode.
good solution is the one with .ssh/environment file:
in /etc/ssh/sshd_config add:
PermitUserEnvironment yes
Then just create .ssh/ directory and dump envronment to .ssh/enviroment:
cd ~/
mkdir .ssh
env > .ssh/environment
Restart SSH
/etc/init.d/sshd restart
Now when you do this from your local machine:
ssh you@server.com "which git-upload-pack"
you s'd get
/usr/local/bin/git-upload-pack
and git clone s'd work.