I had the same error info/refs not found
when I was cloning a local repository and serving it via http.
It seems that cloning a repository doesn't create the info/refs file and therefore it cannot been served remotely (https, ssh etc.)
as remotely there is no way to get the name of the master branch without listing the .git folder, so the info/refs provides the path and the commitid for current git repository HEAD .
mkdir clone-without-refs; cd clone-without-refs
git clone ../origin.git .
ls -l .git/info
so I created it by hand this way (in the source repository, assuming you run a /bin/sh
type of shell)
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
then I did my cloning again and it worked (change $origin
with yours):
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