git set remote path to git executable files over ssh
I connect over ssh to a distant machine using this in my
Host myserver User myusername ProxyCommand ssh myserver2 exec nc myserver 22
But when I try to pull the remote git repository, I obtain this error:
% git pull myserver:~/mygitrepository zsh:1: command not found: git-upload-pack fatal: The remote end hung up unexpectedly
The problem is that my git executable files are not in standard path defined by $PATH. On the remote machine:
% which git-upload-pack /c5/shared/git/1.7.6/bin/git-upload-pack
and on the local machine:
% ssh myserver "env | grep PATH" PATH=/usr/local/bin:/bin:/usr/bin
ssh doesn’t read the remote PATH definition in .zshrc or .bashrc. How can I define the PATH to git executable files over ssh?
One Solution collect form web for “git set remote path to git executable files over ssh”
Actually I’ve found my answer here. One solution is to set the upload-pack path in the remote using :
git pull --upload-pack=/c5/shared/git/1.7.6/bin/git-upload-pack myserver:~/mygitrepository
in the client.