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:
- Abbreviate commonly used option to multiple git commands
- WARNING: this script is deprecated, please see git-completion.zsh
- Git Log not showing accents
- Git: Getting total numbers of uncomitted lines in a repo
- Brew Git Bash Completion with zsh
- How to add git vcs_info to the prompt_bart_setup theme in zsh?
% 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.