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
My solution for this problem
Check path for the git-upload-pack on your remote machine:
ssh yourname@IP-addressORdomain 'which git-upload-pack'
If it gives a path - copy it (without git-upload-pack and trailing slash. Examples: /usr/bin, /home/yourname/bin, /whatever/gituploadpack/path, etc.).
Check your PATH on the remote machine during login shell:
ssh yourname@IP-addressORdomain 'echo $PATH'
There is no such a path (/whatever/gituploadpack/path), is not it? Good!
Login to your remote machine:
ssh yourname@IP-addressORdomain
Open .bashrc_profile:
nano /home/yourname/.bashrc_profile
Find these lines if any:
if [ -f ~/.bashrc ]; then
~/.bashrc
fi
...and change them for:
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
Open .bashrc:
nano /home/yourname/.bashrc
Add these 4 lines:
if [ -d "/whatever/gituploadpack/path" ] ; then
PATH="$PATH:/whatever/gituploadpack/path"
fi
export PATH
Exit the remote machine:
exit
Check your PATH on the remote machine during login shell:
ssh yourname@IP-addressORdomain 'echo $PATH'
Do you see /whatever/gituploadpack/path? Congrats!
Note now you've solved not only git-upload-pack problem but also git-receive-pack and other executables on your /whatever/gituploadpack/path!