git clone + ssh + エラー
git clone を ssh 越しにやったらエラーが出たので対処メモ。
エラーまでの軌跡
サーバ作業:
$ mkdir -p repos/test/bare
$ cd repos/test/bare
$ git --bare init
クライアント作業:
$ git clone machine:/home/user/repos/test/bare/ testdir
Initialized empty Git repository in /Users/user/Documents/projects/repos/test/testdir/.git/
bash: git-upload-pack: command not found
fatal: The remote end hung up unexpectedly
git-upload-pack なんてコマンドねーよって言われた。
クライアント側のパスはどう考えても問題なさそう。
サーバ側もパスは通ってるはずなんだけどナーと調べていくと、
どうも .bash_profile ではなくて .bashrc でパス通してあげる必要があるっぽい。
.bashrc でパス通す
サーバ作業:
$ vi ~/.bashrc
PATH=$PATH:/usr/local/git/bin
Mac 固有の問題なのかなー。