# # # Git Smart HTTP Support (read/write) # git push, clone and fetch allowed SetEnv GIT_PROJECT_ROOT /srv/git SetEnv GIT_HTTP_EXPORT_ALL 1 # Expose git-upload/receive-pack and info/refs. ScriptAliasMatch "^(/.+/(git-upload-pack|git-receive-pack|info/refs))$" \ /usr/libexec/git-core/git-http-backend$1 # Authenticate against git push. AuthType Basic AuthName "Git Push Access" AuthUserFile ${GIT_HTTP_AUTH_FILE} Require valid-user # Only allow git-upload-pack or git-receive-pack services and nothing else. AuthType Basic AuthName "Git Push Access" AuthUserFile ${GIT_HTTP_AUTH_FILE} # git clone/fetch, no auth Require expr %{QUERY_STRING} == "service=git-upload-pack" # git push, authenticated Require expr %{QUERY_STRING} == "service=git-receive-pack" Require valid-user # Allow git clone/fetch w/o auth. Require all granted