Export git repository with SSH and HTTP

When I was first experimenting with GIT I was administering the server using the wbm-virtualmin-git plugin for Virtualmin. As a result, I was using the HTTP protocol to access the git repository and preform user authentication.

After struggling with the performance hit of HTTP (for some reason GIT used a lot of memory using this connection method). I decided to switch over to the SSH / public key method of accessing the repository. However, this created a new problem. It seemed that the changes pushed over the SSH connection would not be visible to any git repos who were using the HTTP address as their remote!

As it turns out, if you wish to export the repository using so-called “dumb servers” git-update-server-info must be called after each commit to update auxiliary info files. This can easily be accomplished by enabling the default post-update hook by navigating to the .git directory for the repository hosted on the server and issuing:

mv hooks/post-update.sample hooks/post-update

More information can be found in the git docs: Exporting Via Http | git-update-server-info | githooks