apache - Cloning git repository over HTTP on personal server results in cloning an empty repository -
i have git repository hosted on personal, debian based, apache web server. if access like:
git "command" user@server:/path/to/repo.git
i can clone, push, pull, etc. no problem. next, added virtual host , added sub-domain dns record git.domain.com went directory in storing repositories in. can navigate git.domain.com/repo.git , see files , directories in repository. but, when try clone through http domain: git clone git.domain.com/repo.git
results in error:warning: appear have cloned empty repository.
thrown error because can clone ssh, , interally on server (git clone /path/to/repo
) , web server should serving files how internally.
after cloned , recieved empty repository, went repository directory , ran git show-ref
, command went through (without failure) had no output.
any appreciated. thank you!
when exposing repository called "dumb http backend" (a web server serving git directory), required keep files date. default, git not keep these files date, since mean using unneeded cpu cycles tiny part of git users use.
you can directly update these files using git update-server-info
, care should taken after every change repo keep files date.
making sure file stays date, configuring git automatically run above named command when push comes using transport. can enabled going .git/hook
, , renaming post-update.sample
post-update
.
notice running git on http way can create high server load because needs request many files server, , isn't smart enough download pack files partially if client has parts of file. behaviour can improved using smart git http backend, explained https://git-scm.com/book/en/v2/git-on-the-server-smart-http
Comments
Post a Comment