I've just changed the git remote for my server, and now when I try to use git push web master, (after staging and committing the changes), I get this:

bash: git-receive-pack: command not found
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

It comes up immediately after pressing enter, so it's had barely any time to check the server. I've already tried adding export PATH=$PATH:/usr/local/git/bin to .bashrc in my home directory. I use Mac OS X, 10.9.5.

Thanks for any help :)

  • I'd start by finding out if your current PATH reflects where that command really lives. Ty[e which git-receive-pack. I've had occasions where git is trying to call a command that hasn't been installed. Try find / -name git-receive-pack.
    – unkilbeeg
    Oct 3, 2014 at 20:16
  • which git-receive-pack returns /usr/local/git/bin/git-receive-pack. What should I be looking for with find / -name git-receive-pack? It returns a whole load of paths, many with Permission Denied. at the end - what should I be looking for?
    – Tom Oakley
    Oct 3, 2014 at 20:23
  • Well, you probably don't need to do the find if which sees it. For future reference, you might want to run find as root (su or sudo? I assume Mac has something like that.) It may be that git calls bash without using your .bashrc. Can you set the PATH more globally?
    – unkilbeeg
    Oct 3, 2014 at 21:02
  • What do you mean? What would I type in .bashrc to set the $PATH more globally?
    – Tom Oakley
    Oct 6, 2014 at 14:18
  • It wouldn't be in .bashrc. That's your local, user-level bash configuration. I don't know MacOS, but in other unices you might edit /etc/bashrc or /etc/environment or something similar.
    – unkilbeeg
    Oct 6, 2014 at 16:37

1 Answer 1


Just install git on the remote machine:

sudo apt install git

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .