git-upload-pack: command not found

I just tried to clone a git repository over the local network, and received this message:

zsh:1: command not found: git-upload-pack
fatal: The remote end hung up unexpectedly

As I understand it (and I might be wrong), your path can change depending on where you're logging in from. Run this command on the REMOTE machine:

which git-upload-pack

and find out where that command actually exists. Then, run this on your LOCAL machine:

ssh yourself@REMOTEmachine echo \$PATH

which will log in, and tell you what your new path is. For me, the new path didn't contain the location of git-upload-pack, which is installed on MacPorts, which puts it in the /opt/local/bin directory. Create/update the following file on the REMOTE machine in your home folder:

.zshenv if you're running Zsh
.bashrc if you're running Bash

and include the new path with the location of the git commands.