Skip to content

Instantly share code, notes, and snippets.

@n-shinya
Last active December 13, 2015 17:58
Show Gist options
  • Save n-shinya/4951715 to your computer and use it in GitHub Desktop.
Save n-shinya/4951715 to your computer and use it in GitHub Desktop.

GitをHTTPで公開する

Git - setting up a remote repository (serve via HTTP)

Edit your "httpd.conf"

SetEnv GIT_PROJECT_ROOT /var/www/git
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /git /usr/bin/git-http-backend/

Create a bare repository

$ cd /var/www/git
$ mkdir test.git
$ cd test.git
$ git init --bare --shared=true

But, Error...

$ git push origin master
error: Cannot access URL http://xx.xx.xx.xx/git/test.git/, return code 22
fatal: git-http-push failed

Set config "receivepack"!

$ cd /var/www/git
$ mkdir test.git
$ cd test.git
$ git config --file config http.receivepack true
@n-shinya
Copy link
Author

WebDAVはだめ。超遅い。HTTPで公開するならgit-http-backendを使うのが常識。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment