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
When I try to clone a repository on my server, I get the following:
bash: git-upload-pack: command not found
But when I clone by giving clone the -u /usr/local/bin/git-upload-pack
option, all works well.
I guess this makes sense, since that's the position of the git-upload-pack on my server.
The top answer suggests my .bashrc file on server needs to be updated to reflect this, as the result of ssh you@remotemachine echo \$PATH
does not return /usr/local/bin
. (It returns /usr/bin:/bin:/usr/sbin:/sbin
).
But when I look at my .bashrc file, it contains:
export PATH=/usr/local/bin:$PATH
So now I'm confused.
What do I need to do to avoid using the -u /usr/local/bin/git-upload-pack
option every time? Why does ssh you@remotemachine echo \$PATH
not return /usr/local/bin
? Is this something to do with login and non-login shells?
Please help! Thanks in advance.