info/refs not found
ローカルリポジトリのクローンを作成し、http経由で提供しているときにも同じエラーが発生しました。
リポジトリのクローンを作成してもinfo/refsファイルが作成されないため、リモート(https、sshなど)で提供できないようです。リモートでは、.gitフォルダーを一覧表示せずにマスターブランチの名前を取得する方法がないためです。したがって、info / refsは、現在のgitリポジトリHEADのパスとcommitidを提供します。
mkdir clone-without-refs; cd clone-without-refs
git clone ../origin.git .
ls -l .git/info
/bin/sh
だから私はこの方法でそれを手作業で作成しました(あなたがシェルのタイプを実行していると仮定して、ソースリポジトリで)
gitid=$(git rev-parse HEAD)
echo HEAD: $gitid
echo -e "$gitid\trefs/heads/master" > .git/info/refs
if [ ! -e .git/refs/heads/master ]; then
echo $gitid > .git/refs/heads/master
fi
それから私は再び私のクローンを作りました、そしてそれはうまくいきました($origin
あなたのもので変えてください):
rm -rf ../cloned
# checking if refs file is there (httpds server side):
origin="http://localhost:8080/~$USER/$(pwd|sed -e "s,$HOME/,,")/.git"
curl $origin/info/refs
git clone $origin ../cloned
# verify
git -C ../cloned log -2