I installed the git repository module as was given in the tutorial page. However I ran in to a lot of problems.
The mydomain.com/git/something.git would always show 403 forbidden error despite the number of repositories I make.
I follow the instructions to clone to a local repository but I just can’t seem to push back after an initial commit. It always says git-push-http error, code 22.
Please Help! Time taken inversely proportional to my hair count.
Had the same problem, at least the following changes worked for me:
- after creating the repo, check the file gitweb.cgi
- lines 49/50 should be corrected; once the git_base_url is correct, the "browse repository" button works ok, but there's no snapshot.cgi so the snapshots_url does not work. So - seems to be a bug in virtualmin-git, that git_base_url isn't correctly set, at least under Debian Wheezy.
- I had to change line 31 $gitbin to /usr/lib/git-core, as "/usr/bin/git-rev-list" was not found using "/usr/bin" default setting, perhaps related to Wheezy, too.
- the default gitweb.cgi used is /usr/share/webmin/virtualmin-git/gitweb.cgi.source.new, so I could change $gitbin there - I think these should be configurable options in virtualmin-git module (Feature Request!)
- the repo push error is a client issue, see: http://www.mkonrad.net/Blog/Git-over-HTTPWebDAV-A-solution-for-git-http-push-failed-errors; using .netrc to store login resolves it
i have also been experiencing issues with getting gitweb.cgi to work out of the box with its virtualmin module and counterpart;
i have filed a bug report (although, it may not be a bug?),
i followed the steps outlined above, and corrected the paths… after changing the apache directory permissions on the git directories to allow cgi execution, i could finally log in to these directories using the browser.
however, the CGI wrapper is throwing errors when attempting to perform any critical operations:
gitweb.cgi: Use of uninitialized value $epoch in gmtime at gitweb.cgi line 813., referer: https://website.com/git/gitweb.cgi?p=ispman.git;a=commit;h=
gitweb.cgi: Use of uninitialized value $epoch in addition (+) at gitweb.cgi line 823.,
gitweb.cgi: Use of uninitialized value $head in concatenation (.) or string at gitweb.cgi line 129.,
gitweb.cgi: Use of uninitialized value $head in concatenation (.) or string at gitweb.cgi line 130.,
what i extracted from the actual error reported on the page:
403 Forbidden - Invalid hash parameter.
403 Forbidden - Reading tree failed.
considering i am still new to Git, and coming from SVN, i assume that although the gitweb.cgi wrapper is broken, WebDAV and remote authoring might still work- but i will have to do further testing. if this IS the case, i guess i could tell people that they can only create, delete, and change permissions on
not sure whether to remove Git support until things are fixed, or if there might some trivial fix in which i seem to be missing…
any help would be greatly appreciated! virtualmin is a great product, and integration with Git would be fantastic to offer my clients
okay so, after some hard work, i figured out a solution to my problems.
first, the solutions was to follow the steps outline above by : lulatsch66
Next, the Gitweb wrapper used by virtualmin seems to be possibly out of date;
Considering if gitweb was installed from the repository, the solution to fix gitweb.cgi was to copy the repository installed gitweb.cgi, including dependencies (files under ./static in the gitweb template directory) to the users ./git directory, fix permissions (both on the filesystem, and in the users .htaccess), and edit the cgi wrapper within respect to the changes normally made by virtualmin (specify repository path, etc)
after this, some final changes would be to edit /etc/gitweb.conf and comment out the project path directive, in order to always load this from the users configuration
note: on the client side (Windows), i also experience a problem with pushing anything to the repository. along side the suggested .netrc fix, it seems that sometimes there is a dependency issues, and libcurl-4.dll was missing, or was the wrong version. the solution for this is to add git to the PATH directive. if this does not help, try copying libcurl.dll to System32. you may also be able to simply rename libcurl.dll to libcurl-4.dll to in the git bin directory.
hope that this helps somebody! i will duplicate this post into my bug report so that we may get git working out of the box again!