{"id":443,"date":"2013-06-26T09:42:07","date_gmt":"2013-06-26T01:42:07","guid":{"rendered":"http:\/\/blog.marvelplanet.tk\/?p=443"},"modified":"2013-09-13T08:50:38","modified_gmt":"2013-09-13T00:50:38","slug":"git-over-http-and-the-first-repos-push","status":"publish","type":"post","link":"https:\/\/marvelliu.space\/?p=443","title":{"rendered":"git over http and the first repos push"},"content":{"rendered":"<h2><strong>Apache virtual host setup<\/strong><\/h2>\n<p>cat \/etc\/apache2\/sites-enabled\/git<\/p>\n<pre>\r\n&lt;VirtualHost 192.168.1.1:80&gt;\r\nServerName git.expr.nsfocus\r\nDocumentRoot \/var\/www\/git\/\r\n\r\nSetEnv GIT_PROJECT_ROOT \/var\/www\/git\/\r\nSetEnv GIT_HTTP_EXPORT_ALL\r\nScriptAlias \/repos\/ \/usr\/lib\/git-core\/git-http-backend\/\r\nOptions Indexes FollowSymLinks MultiViews\r\n&lt;Location \/repos\/&gt;\r\nAuthType Basic\r\nAuthName \"Restricted Files\"\r\nAuthUserFile \/etc\/apache2\/password.dav\r\nRequire valid-user\r\n&lt;\/Location&gt;\r\n&lt;\/VirtualHost&gt;\r\n<\/pre>\n<p>htpasswd -c\u00a0 \/etc\/apache2\/password.dav youraccount<\/p>\n<h2>Server side repos init<\/h2>\n<p>mkdir -p \/var\/www\/git\/app\/<br \/>\ngit init &#8211;bare(\u6b64\u5904\u4e3a\u4e24\u4e2a-)<br \/>\ngit update-server-info<br \/>\nchown www-data.www-data -R \/var\/www\/git\/app\/<\/p>\n<h2>Client side repos push<\/h2>\n<p>cd d:\\app<br \/>\nedit .gitignore<br \/>\ngit init<br \/>\ngit add *<br \/>\ngit commit -a -m &#8220;first commit&#8221;<br \/>\ngit remote add origin http:\/\/git.expr.region\/app\/<br \/>\ngit push -u origin master<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apache virtual host setup cat \/etc\/apache2\/sites-enabled\/git &lt;VirtualHost 192.168.1.1:80&gt; ServerName git.expr.nsfocus DocumentRoot \/var\/www\/git\/ SetEnv GIT_PROJECT_ROOT \/var\/www\/git\/ SetEnv GIT_HTTP_EXPORT_ALL ScriptAlias \/repos\/ \/usr\/lib\/git-core\/git-http-backend\/ Options Indexes FollowSymLinks MultiViews &lt;Location \/repos\/&gt; AuthType Basic AuthName &#8220;Restricted Files&#8221; AuthUserFile \/etc\/apache2\/password.dav Require valid-user &lt;\/Location&gt; &lt;\/VirtualHost&gt; htpasswd -c\u00a0 \/etc\/apache2\/password.dav youraccount Server side repos init mkdir -p \/var\/www\/git\/app\/ git init &#8211;bare(\u6b64\u5904\u4e3a\u4e24\u4e2a-) git update-server-info chown www-data.www-data &hellip; <a href=\"https:\/\/marvelliu.space\/?p=443\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;git over http and the first repos push&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-443","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/marvelliu.space\/index.php?rest_route=\/wp\/v2\/posts\/443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/marvelliu.space\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/marvelliu.space\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/marvelliu.space\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/marvelliu.space\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=443"}],"version-history":[{"count":6,"href":"https:\/\/marvelliu.space\/index.php?rest_route=\/wp\/v2\/posts\/443\/revisions"}],"predecessor-version":[{"id":502,"href":"https:\/\/marvelliu.space\/index.php?rest_route=\/wp\/v2\/posts\/443\/revisions\/502"}],"wp:attachment":[{"href":"https:\/\/marvelliu.space\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/marvelliu.space\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/marvelliu.space\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}