git set remote path to git executable files over ssh

I connect over ssh to a distant machine using this in my ~/.ssh/config:

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:

  • egit - not authorized
  • Collapsing a Group of Commits into One on Git
  • GitHub for Windows says that there are uncommited changes even though the diffs are empty
  • Azure - deploying from Bitbucket
  • Git ignore is not ignoring the netbeans private files
  • git svn rebase index file open failed : Invalid argument
  • % 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

    and on the local machine:

    % ssh myserver "env | grep PATH"

    ssh doesn’t read the remote PATH definition in .zshrc or .bashrc. How can I define the PATH to git executable files over ssh?

  • How do I Gitnore all files except two subdirectories?
  • How do you get git bisect to ignore merged branches?
  • what does git ignorecase really do? how to checkout respecting file capitalisation?
  • git init, add, commit from a different directory
  • tried to push to GitHub, now getting 'fatal: bad default revision'
  • Output every file status in a git tree
  • 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.

    Git Baby is a git and github fan, let's start git clone.