git-receive-pack:找不到命令

Phi*_*eau 6 ssh terminal version-control git macos

我使用“git init --bare”在本地机器上创建了一个git repo,并使用ssh将其添加为我主计算机上项目的远程源:

git add remote origin git@192.168.1.14:repoName.git
Run Code Online (Sandbox Code Playgroud)

在创建 repo 的那天,我能够提交并从我的主计算机推送到另一台计算机,但是今天我尝试了,但没有成功。

当我执行“git push origin”时,它返回了这个错误:

bash: line 1: git-receive-pack: command not found
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)

两台机器是mac,一台运行Leopard,一台运行Tiger。我认为它可能与服务器上 git 的 $PATH 相关,但我不确定。

我使用这些指令来创建我的 git 服务器:http : //blog.commonthread.com/2008/4/14/setting-up-a-git-server

Phi*_*eau 7

好的,所以我解决了我的问题。

我看起来问题是 ssh 没有读取 .bash_profile 我必须做的是写

export PATH=$PATH:/usr/local/bin
Run Code Online (Sandbox Code Playgroud)

在 .bashrc 中,因为 ssh 读取该文件。