I've started evaluating a piece of software called subgit which seamlessly allows you to interface a repo with either SVN or GIT.
Throughout our organization we interface our repos using apache, and trying to combine this with GIT becomes somewhat troublesome.
Overall we want to permit read-access without authentication, and write should be authenticated, this works fine with SVN but doesn't seem to be as straight-forward with GIT.
In addition to this it would be neat to have apache identify whether it's a GIT/SVN request and figure out where to point the client so that you can use the same url regardless of what repo-system you're using.
Below is the config, right now we've proper read-access w/o auth for svn and write-access with auth, but for GIT it's r/w without authentication.
ServerName android.subgit.domain.tld
DocumentRoot /home/subgit/public_html
CustomLog /home/subgit/logs/access_log combined
SetEnv GIT_PROJECT_ROOT /home/subgit/repos/subgit-repo
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv REMOTE_USER $REDIRECT_REMOTE_USER
ScriptAlias /git/ /usr/local/libexec/git-core/git-http-backend/
<LocationMatch "/svn">
DAV svn
SVNPath /home/subgit/repos/subgit-repo
Include /etc/apache2/conf.d/auth-mysql
AuthzSVNAccessFile /home/subgit/etc/subgit-repo
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</LocationMatch>
<LocationMatch "/git">
Options +ExecCGI
</LocationMatch>
<Directory "/usr/local/libexec/git-core/git-receive-pack">
Include /etc/apache2/conf.d/auth-mysql
Require valid-user
</Directory>
</VirtualHost>
Any input would be appreciated!
来源:https://stackoverflow.com/questions/15077164/git-svn-with-subgit-and-apache