{"id":12748,"date":"2025-04-18T19:47:55","date_gmt":"2025-04-18T11:47:55","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/12748.html"},"modified":"2025-04-18T19:47:55","modified_gmt":"2025-04-18T11:47:55","slug":"%e5%9b%be%e8%a7%a3git-%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e7%9a%84git%e3%80%8apro-git%e3%80%8b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/12748.html","title":{"rendered":"\u56fe\u89e3Git\u2014\u2014\u670d\u52a1\u5668\u4e0a\u7684Git\u300aPro Git\u300b"},"content":{"rendered":"<h2 id=\"Z41Xu\">\u534f\u8bae<\/h2>\n<h3 id=\"g19EY\">1. Git \u8fdc\u7a0b\u4ed3\u5e93\u53ca\u901a\u4fe1\u534f\u8bae\u6982\u8ff0<\/h3>\n<h4 id=\"nX3e8\">1.1. \u8fdc\u7a0b\u4ed3\u5e93\u7684\u91cd\u8981\u6027<\/h4>\n<li id=\"ueef9b827\">\u4f5c\u7528&#xff1a;\u63d0\u4f9b\u534f\u4f5c\u5e73\u53f0&#xff0c;\u652f\u6301\u56e2\u961f\u5171\u4eab\u4ee3\u7801&#xff0c;\u5373\u4f7f\u4e3b\u673a\u79bb\u7ebf&#xff0c;\u5176\u4ed6\u4eba\u4ecd\u53ef\u8bbf\u95ee\u3002<\/li>\n<li id=\"u33028a42\">\u5e38\u89c1\u5f62\u5f0f&#xff1a;\u88f8\u4ed3\u5e93&#xff08;\u4e0d\u542b\u5de5\u4f5c\u76ee\u5f55&#xff0c;\u4ec5\u4fdd\u5b58 Git \u5143\u6570\u636e&#xff09;\u3002<\/li>\n<hr id=\"ZaO7h\" \/>\n<h3 id=\"D7tyk\">2. Git \u652f\u6301\u7684\u534f\u8bae\u7c7b\u578b<\/h3>\n<h5 id=\"345423ba\">1. \u672c\u5730\u534f\u8bae<\/h5>\n<ul>\n<li id=\"uc713effd\">\u9002\u7528\u573a\u666f&#xff1a;<\/li>\n<\/ul>\n<ul>\n<li>\n<ul>\n<li id=\"u25f8634a\">\u5728\u540c\u4e00\u53f0\u4e3b\u673a\u6216\u5171\u4eab\u6587\u4ef6\u7cfb\u7edf&#xff08;\u5982 NFS&#xff09;\u4e0a\u4f7f\u7528\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li id=\"uce7b2e1d\">\u4f18\u70b9&#xff1a;<\/li>\n<\/ul>\n<ul>\n<li>\n<ul>\n<li id=\"u4575e2fe\">\u914d\u7f6e\u7b80\u5355&#xff0c;\u901f\u5ea6\u5feb\u3002<\/li>\n<li id=\"u3e6d8625\">\u5229\u7528\u73b0\u6709\u6587\u4ef6\u6743\u9650&#xff0c;\u65b9\u4fbf\u4e0e\u56e2\u961f\u5feb\u901f\u5171\u4eab\u4ee3\u7801\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li id=\"u1c270d0b\">\u7f3a\u70b9&#xff1a;<\/li>\n<\/ul>\n<ul>\n<li>\n<ul>\n<li id=\"u361ca4d1\">\u4f9d\u8d56\u5171\u4eab\u6587\u4ef6\u7cfb\u7edf&#xff0c;\u4e0d\u4fbf\u4e8e\u8fdc\u7a0b\u8bbf\u95ee\u3002<\/li>\n<li id=\"u4c523c8e\">\u65e0\u6cd5\u9632\u6b62\u7528\u6237\u76f4\u63a5\u4fee\u6539\u6216\u7834\u574f\u4ed3\u5e93\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr id=\"oOMS6\" \/>\n<h5 id=\"118b9e71\">2. \u2b50HTTP\/HTTPS \u534f\u8bae<\/h5>\n<ul>\n<li id=\"u0680be24\">\u667a\u80fd HTTP \u534f\u8bae&#xff1a;\u63a8\u8350\u65b9\u5f0f&#xff0c;\u652f\u6301\u7528\u6237\u540d\/\u5bc6\u7801\u6388\u6743&#xff0c;\u4f20\u8f93\u6570\u636e\u52a0\u5bc6&#xff0c;\u9002\u5408\u73b0\u4ee3\u534f\u4f5c\u573a\u666f\u3002<\/li>\n<li id=\"u23cbf4d6\">\u54d1&#xff08;Dumb&#xff09;HTTP \u534f\u8bae&#xff1a;\u4ec5\u652f\u6301\u53ea\u8bfb\u8bbf\u95ee&#xff0c;\u7b80\u5355\u6613\u914d\u7f6e\u3002<\/li>\n<li id=\"udc27e536\">\u4f18\u70b9&#xff1a;<\/li>\n<\/ul>\n<ul>\n<li>\n<ul>\n<li id=\"u8a8e9f28\">\u7b80\u5355\u6613\u7528&#xff0c;\u5e7f\u6cdb\u652f\u6301&#xff08;\u4f01\u4e1a\u9632\u706b\u5899\u901a\u5e38\u5141\u8bb8&#xff09;\u3002<\/li>\n<li id=\"u19d591b8\">\u652f\u6301 HTTPS \u63d0\u4f9b\u5b89\u5168\u4f20\u8f93&#xff0c;\u53ef\u7075\u6d3b\u8bbe\u7f6e\u533f\u540d\u548c\u6388\u6743\u8bbf\u95ee\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li id=\"u7aeac39e\">\u7f3a\u70b9&#xff1a;<\/li>\n<\/ul>\n<ul>\n<li>\n<ul>\n<li id=\"u6cc8a768\">\u9700\u8981\u7ef4\u62a4\u8bc1\u4e66&#xff0c;\u6388\u6743\u7ba1\u7406\u6bd4 SSH \u590d\u6742\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr id=\"lAhAz\" \/>\n<h5 id=\"3c91a897\">3. SSH \u534f\u8bae<\/h5>\n<ul>\n<li id=\"u44fc928e\">\u9002\u7528\u573a\u666f&#xff1a;\u4f01\u4e1a\u5185\u90e8\u534f\u4f5c\u548c\u9700\u8981\u5b89\u5168\u8bbf\u95ee\u7684\u573a\u666f\u3002<\/li>\n<li id=\"u7afb8ce9\">\u4f18\u70b9&#xff1a;<\/li>\n<\/ul>\n<ul>\n<li>\n<ul>\n<li id=\"ubbc00c83\">\u914d\u7f6e\u7b80\u5355&#xff0c;\u5185\u7f6e\u4e8e\u5927\u591a\u6570\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u3002<\/li>\n<li id=\"u004490f9\">\u63d0\u4f9b\u52a0\u5bc6\u4f20\u8f93\u548c\u7528\u6237\u9a8c\u8bc1&#xff0c;\u901f\u5ea6\u9ad8\u6548\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li id=\"u96832277\">\u7f3a\u70b9&#xff1a;<\/li>\n<\/ul>\n<ul>\n<li>\n<ul>\n<li id=\"u9dff2786\">\u4e0d\u652f\u6301\u533f\u540d\u8bbf\u95ee&#xff0c;\u9700\u624b\u52a8\u914d\u7f6e\u516c\u94a5&#xff0c;\u589e\u52a0\u65b0\u7528\u6237\u7684\u8bbe\u7f6e\u6210\u672c\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr id=\"zGYYa\" \/>\n<h5 id=\"92fbf5df\">4. Git \u534f\u8bae<\/h5>\n<ul>\n<li id=\"uf96ee290\">\u7279\u70b9&#xff1a;\u57fa\u4e8e\u7279\u6b8a\u7684 Git \u5b88\u62a4\u8fdb\u7a0b&#xff0c;\u652f\u6301\u533f\u540d\u8bbf\u95ee&#xff0c;\u65e0\u9700\u6388\u6743\u3002<\/li>\n<li id=\"ued711be8\">\u4f18\u70b9&#xff1a;<\/li>\n<\/ul>\n<ul>\n<li>\n<ul>\n<li id=\"uab7d95f9\">\u6027\u80fd\u6700\u9ad8&#xff0c;\u9002\u5408\u9ad8\u8bbf\u95ee\u91cf\u6216\u53ea\u8bfb\u573a\u666f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li id=\"u784d250d\">\u7f3a\u70b9&#xff1a;<\/li>\n<\/ul>\n<ul>\n<li>\n<ul>\n<li id=\"ud8fa738f\">\u65e0\u6388\u6743\u673a\u5236&#xff0c;\u65e0\u6cd5\u63d0\u4f9b\u63a8\u9001\u6743\u9650\u7ba1\u7406\u3002<\/li>\n<li id=\"u0005f49b\">\u9700\u8981\u5f00\u653e\u975e\u6807\u51c6\u7aef\u53e3&#xff08;9418&#xff09;&#xff0c;\u914d\u7f6e\u590d\u6742\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr id=\"LZGhP\" \/>\n<h3 id=\"YCzRY\">3. \u603b\u7ed3\u4e0e\u9009\u62e9<\/h3>\n<li id=\"u9a0244e2\">\u672c\u5730\u534f\u8bae&#xff1a;\u9002\u5408\u56e2\u961f\u5728\u5171\u4eab\u6587\u4ef6\u7cfb\u7edf\u4e0a\u4f7f\u7528&#xff0c;\u4f46\u5c40\u9650\u4e8e\u5355\u4e00\u7f51\u7edc\u73af\u5883\u3002<\/li>\n<li id=\"u37ac7bb5\">HTTP\/HTTPS \u534f\u8bae&#xff1a;\u63a8\u8350\u667a\u80fd HTTP&#xff0c;\u9002\u5408\u7edd\u5927\u591a\u6570\u56e2\u961f\u534f\u4f5c\u573a\u666f\u3002<\/li>\n<li id=\"u654bfe99\">SSH \u534f\u8bae&#xff1a;\u9002\u5408\u4f01\u4e1a\u5185\u90e8\u4f7f\u7528&#xff0c;\u5b89\u5168\u4e14\u9ad8\u6548\u3002<\/li>\n<li id=\"ub3b15c7f\">Git \u534f\u8bae&#xff1a;\u9002\u5408\u63d0\u4f9b\u9ad8\u6548\u53ea\u8bfb\u8bbf\u95ee&#xff0c;\u4f46\u4e0d\u9002\u7528\u4e8e\u9700\u8981\u6388\u6743\u63a7\u5236\u7684\u573a\u666f\u3002<\/li>\n<p id=\"ubedc258a\">\u9009\u62e9\u534f\u8bae\u65f6&#xff0c;\u53ef\u6839\u636e\u534f\u4f5c\u9700\u6c42\u3001\u8bbf\u95ee\u573a\u666f\u3001\u5b89\u5168\u6027\u548c\u914d\u7f6e\u96be\u5ea6\u8fdb\u884c\u6743\u8861\u3002<\/p>\n<hr id=\"ssKel\" \/>\n<h2 id=\"TLQCO\">\u670d\u52a1\u5668\u4e0a\u642d\u5efa Git<\/h2>\n<h5 id=\"GR1ik\">1. \u521b\u5efa\u88f8\u4ed3\u5e93<\/h5>\n<ul>\n<li id=\"u747023d4\">\u4f7f\u7528 &#8211;bare \u9009\u9879\u5c06\u73b0\u6709\u7684 Git \u4ed3\u5e93\u5bfc\u51fa\u4e3a\u88f8\u4ed3\u5e93&#xff0c;\u8fd9\u6837\u4ed3\u5e93\u4e0d\u5305\u542b\u5de5\u4f5c\u76ee\u5f55&#xff0c;\u9002\u7528\u4e8e\u670d\u52a1\u5668\u4e0a\u7684\u534f\u4f5c&#xff1a;<\/li>\n<\/ul>\n<p>$ git clone &#8211;bare my_project my_project.git <\/p>\n<p id=\"u8671f1bc\">\u6216\u8005&#xff1a;<\/p>\n<p>$ cp -Rf my_project\/.git my_project.git <\/p>\n<h5 id=\"yc4E9\">2. \u4e0a\u4f20\u88f8\u4ed3\u5e93\u5230\u670d\u52a1\u5668<\/h5>\n<ul>\n<li id=\"ub00763a2\">\u5047\u8bbe\u670d\u52a1\u5668\u57df\u540d\u4e3a git.example.com&#xff0c;\u5c06\u88f8\u4ed3\u5e93\u4e0a\u4f20\u5230\u670d\u52a1\u5668\u7684\u6307\u5b9a\u76ee\u5f55&#xff08;\u5982 \/srv\/git&#xff09;&#xff1a;<\/li>\n<\/ul>\n<p>$ scp -r my_project.git user&#064;git.example.com:\/srv\/git <\/p>\n<h5 id=\"R8zTi\">3. \u521d\u59cb\u5316\u5171\u4eab\u4ed3\u5e93<\/h5>\n<ul>\n<li id=\"uc783d562\">\u767b\u5f55\u5230\u670d\u52a1\u5668&#xff0c;\u8fdb\u5165\u4ed3\u5e93\u76ee\u5f55&#xff0c;\u5e76\u4f7f\u7528 &#8211;bare \u548c &#8211;shared \u521d\u59cb\u5316\u4ed3\u5e93&#xff0c;\u8fd9\u6837\u4ed3\u5e93\u5bf9\u540c\u7ec4\u7528\u6237\u53ef\u5199&#xff1a;<\/li>\n<\/ul>\n<p>$ ssh user&#064;git.example.com<br \/>\n$ cd \/srv\/git\/my_project.git<br \/>\n$ git init &#8211;bare &#8211;shared <\/p>\n<h5 id=\"rKjs3\">4. \u56e2\u961f\u6210\u5458\u514b\u9686\u4ed3\u5e93<\/h5>\n<ul>\n<li id=\"ued5e7fbd\">\u5176\u4ed6\u56e2\u961f\u6210\u5458\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u901a\u8fc7 SSH \u514b\u9686\u4ed3\u5e93&#xff1a;<\/li>\n<\/ul>\n<p>$ git clone user&#064;git.example.com:\/srv\/git\/my_project.git <\/p>\n<h5 id=\"c3kkw\">5. \u7528\u6237\u6743\u9650\u7ba1\u7406<\/h5>\n<ul>\n<li id=\"u2df7633c\">\u4e3a\u6bcf\u4e2a\u7528\u6237\u521b\u5efa\u670d\u52a1\u5668\u8d26\u6237&#xff1a;\u901a\u8fc7\u5728\u670d\u52a1\u5668\u4e0a\u4e3a\u6bcf\u4e2a\u5f00\u53d1\u8005\u521b\u5efa\u72ec\u7acb\u8d26\u6237&#xff0c;\u4f7f\u7528\u64cd\u4f5c\u7cfb\u7edf\u7684\u6587\u4ef6\u6743\u9650\u6765\u63a7\u5236\u8bbf\u95ee\u3002<\/li>\n<li id=\"u417d4c7c\">\u4f7f\u7528\u5171\u4eab\u8d26\u6237\u7ba1\u7406 SSH \u5bc6\u94a5&#xff1a;\u521b\u5efa\u4e00\u4e2a git \u7528\u6237&#xff0c;\u56e2\u961f\u6210\u5458\u5c06\u5404\u81ea\u7684 SSH \u516c\u94a5\u6dfb\u52a0\u5230\u8be5\u7528\u6237\u7684 ~\/.ssh\/authorized_keys \u6587\u4ef6\u4e2d&#xff0c;\u6240\u6709\u7528\u6237\u901a\u8fc7 git \u8d26\u6237\u8bbf\u95ee\u4ed3\u5e93\u3002<\/li>\n<li id=\"u9576f642\">\u96c6\u4e2d\u6388\u6743\u673a\u5236&#xff1a;\u53ef\u4ee5\u4f7f\u7528 LDAP \u6216\u5176\u4ed6\u96c6\u4e2d\u7ba1\u7406\u5de5\u5177\u6765\u63a7\u5236\u8bbf\u95ee\u3002<\/li>\n<\/ul>\n<h5 id=\"xehFa\">6. \u9002\u7528\u573a\u666f<\/h5>\n<ul>\n<li id=\"u4ae9cb4d\">\u8fd9\u79cd\u7b80\u5355\u7684\u8bbe\u7f6e\u9002\u5408\u5c0f\u578b\u56e2\u961f\u6216\u521d\u521b\u9879\u76ee&#xff0c;\u53ea\u9700 SSH \u8fde\u63a5\u548c\u88f8\u4ed3\u5e93\u5373\u53ef\u5b9e\u73b0\u56e2\u961f\u534f\u4f5c\u3002<\/li>\n<li id=\"uce42a877\">\u5982\u679c\u9700\u8981\u66f4\u590d\u6742\u7684\u6743\u9650\u63a7\u5236\u6216\u529f\u80fd\u6269\u5c55&#xff08;\u5982\u516c\u5171\u8bbf\u95ee\u3001\u7f51\u9875\u754c\u9762&#xff09;&#xff0c;\u53ef\u4ee5\u5728\u6b64\u57fa\u7840\u4e0a\u8fdb\u884c\u6539\u8fdb\u3002<\/li>\n<\/ul>\n<p id=\"ua61c7caf\">\u603b\u7ed3&#xff1a;\u901a\u8fc7\u88f8\u4ed3\u5e93\u548c SSH \u914d\u5408&#xff0c;\u4f60\u53ef\u4ee5\u8f7b\u677e\u5728\u670d\u52a1\u5668\u4e0a\u642d\u5efa Git \u670d\u52a1&#xff0c;\u6ee1\u8db3\u57fa\u672c\u7684\u56e2\u961f\u534f\u4f5c\u9700\u6c42\u3002\u5bf9\u4e8e\u66f4\u590d\u6742\u7684\u9700\u6c42&#xff0c;\u53ef\u4ee5\u8fdb\u4e00\u6b65\u6269\u5c55\u548c\u4f18\u5316\u3002<\/p>\n<hr id=\"RKnn2\" \/>\n<h2 id=\"MZNbd\">\u751f\u6210 SSH \u516c\u94a5<\/h2>\n<h5 id=\"1f4b9820\">1. \u68c0\u67e5\u73b0\u6709SSH\u5bc6\u94a5<\/h5>\n<ul>\n<li id=\"ucf311f6e\">SSH\u5bc6\u94a5\u9ed8\u8ba4\u5b58\u50a8\u5728 ~\/.ssh \u76ee\u5f55\u4e0b&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5\u662f\u5426\u5df2\u6709\u5bc6\u94a5&#xff1a;<\/li>\n<\/ul>\n<p>$ cd ~\/.ssh<br \/>\n$ ls <\/p>\n<p id=\"ue771f4f4\">\u4f60\u9700\u8981\u627e\u5230\u4e00\u5bf9\u6587\u4ef6&#xff08;\u4f8b\u5982 id_dsa \u548c id_dsa.pub \u6216 id_rsa \u548c id_rsa.pub&#xff09;&#xff0c;.pub \u6587\u4ef6\u662f\u516c\u94a5\u3002<\/p>\n<h5 id=\"a2f4ec5d\">2. \u751f\u6210\u65b0\u7684SSH\u5bc6\u94a5<\/h5>\n<ul>\n<li id=\"u80b49e91\">\u5982\u679c\u6ca1\u6709\u73b0\u6709\u7684\u5bc6\u94a5&#xff0c;\u53ef\u4ee5\u4f7f\u7528 ssh-keygen \u751f\u6210\u4e00\u5bf9\u65b0\u7684\u516c\u94a5\u548c\u79c1\u94a5&#xff1a;<\/li>\n<\/ul>\n<p>$ ssh-keygen -o <\/p>\n<ul>\n<li id=\"u4dcac445\">\u5b83\u4f1a\u8be2\u95ee\u4f60\u5bc6\u94a5\u5b58\u50a8\u4f4d\u7f6e&#xff08;\u9ed8\u8ba4\u662f ~\/.ssh\/id_rsa&#xff09;\u548c\u662f\u5426\u8bbe\u7f6e\u5bc6\u94a5\u5bc6\u7801\u3002\u5982\u679c\u4e0d\u60f3\u8f93\u5165\u5bc6\u7801&#xff0c;\u53ef\u4ee5\u7559\u7a7a\u3002\u4f7f\u7528 -o \u9009\u9879\u6765\u751f\u6210\u66f4\u5b89\u5168\u7684\u5bc6\u94a5\u683c\u5f0f\u3002<\/li>\n<\/ul>\n<h5 id=\"f06c9b23\">3. \u67e5\u770b\u516c\u94a5\u5185\u5bb9<\/h5>\n<ul>\n<li id=\"u20edb3ae\">\u521b\u5efa\u5b8c\u6210\u540e&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u751f\u6210\u7684\u516c\u94a5\u5185\u5bb9&#xff1a;<\/li>\n<\/ul>\n<p>$ cat ~\/.ssh\/id_rsa.pub <\/p>\n<p id=\"u77d39ee4\">\u8be5\u8f93\u51fa\u662f\u516c\u94a5&#xff0c;\u4f60\u9700\u8981\u5c06\u5b83\u53d1\u9001\u7ed9 Git \u670d\u52a1\u5668\u7ba1\u7406\u5458&#xff0c;\u4ee5\u4fbf\u6dfb\u52a0\u5230\u670d\u52a1\u5668\u7684 authorized_keys \u6587\u4ef6\u4e2d\u3002<\/p>\n<h5 id=\"64987c07\">4. \u53d1\u9001\u516c\u94a5<\/h5>\n<ul>\n<li id=\"uac08ffae\">\u5c06\u516c\u94a5&#xff08;.pub \u6587\u4ef6\u4e2d\u7684\u5185\u5bb9&#xff09;\u901a\u8fc7\u90ae\u4ef6\u6216\u5176\u4ed6\u65b9\u5f0f\u53d1\u9001\u7ed9 Git \u670d\u52a1\u5668\u7ba1\u7406\u5458&#xff0c;\u7ba1\u7406\u5458\u5c06\u5176\u6dfb\u52a0\u5230\u670d\u52a1\u5668\u4e0a\u8fdb\u884c\u8ba4\u8bc1\u3002<\/li>\n<\/ul>\n<h5 id=\"8e75cd07\">5. \u907f\u514d\u9891\u7e41\u8f93\u5165\u5bc6\u7801<\/h5>\n<ul>\n<li id=\"u3f6f33f6\">\u5982\u679c\u8bbe\u7f6e\u4e86\u5bc6\u94a5\u5bc6\u7801&#xff0c;\u53ef\u4ee5\u4f7f\u7528 ssh-agent \u5de5\u5177\u6765\u907f\u514d\u6bcf\u6b21\u8fde\u63a5\u65f6\u8f93\u5165\u5bc6\u7801\u3002<\/li>\n<\/ul>\n<p id=\"u26f0d707\">\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4&#xff0c;\u4f60\u53ef\u4ee5\u8f7b\u677e\u751f\u6210 SSH \u516c\u94a5&#xff0c;\u5e76\u5c06\u5176\u7528\u4e8e Git \u670d\u52a1\u5668\u7684 SSH \u9a8c\u8bc1\u3002<\/p>\n<hr id=\"gptkZ\" \/>\n<h2 id=\"SPYt7\">\u914d\u7f6e\u670d\u52a1\u5668<\/h2>\n<h5 id=\"914addf3\">1. \u521b\u5efa\u7cfb\u7edf\u7528\u6237\u548c\u914d\u7f6e SSH<\/h5>\n<ul>\n<li id=\"u38784bd4\">\u521b\u5efa\u64cd\u4f5c\u7cfb\u7edf\u7528\u6237 git&#xff0c;\u5e76\u4e3a\u5176\u5efa\u7acb .ssh \u76ee\u5f55&#xff1a;<\/li>\n<\/ul>\n<p>$ sudo adduser git<br \/>\n$ su git<br \/>\n$ cd<br \/>\n$ mkdir .ssh &amp;&amp; chmod 700 .ssh<br \/>\n$ touch .ssh\/authorized_keys &amp;&amp; chmod 600 .ssh\/authorized_keys <\/p>\n<ul>\n<li id=\"uc8054353\">\u5c06\u53d7\u4fe1\u4efb\u7684\u516c\u94a5\u6dfb\u52a0\u5230 authorized_keys \u6587\u4ef6\u4e2d&#xff1a;<\/li>\n<\/ul>\n<p>$ cat \/tmp\/id_rsa.john.pub &gt;&gt; ~\/.ssh\/authorized_keys<br \/>\n$ cat \/tmp\/id_rsa.josie.pub &gt;&gt; ~\/.ssh\/authorized_keys<br \/>\n$ cat \/tmp\/id_rsa.jessica.pub &gt;&gt; ~\/.ssh\/authorized_keys <\/p>\n<h5 id=\"17eaf4c7\">2. \u521b\u5efa Git \u4ed3\u5e93<\/h5>\n<ul>\n<li id=\"ud11dd713\">\u4f7f\u7528 git init &#8211;bare \u521b\u5efa\u88f8\u4ed3\u5e93&#xff1a;<\/li>\n<\/ul>\n<p>$ cd \/srv\/git<br \/>\n$ mkdir project.git<br \/>\n$ cd project.git<br \/>\n$ git init &#8211;bare <\/p>\n<h5 id=\"5966acd7\">3. \u5f00\u53d1\u8005\u63a8\u9001\u5230\u4ed3\u5e93<\/h5>\n<ul>\n<li id=\"uc5c1fcd2\">\u5f00\u53d1\u8005\u901a\u8fc7 SSH \u63a8\u9001\u9879\u76ee&#xff1a;<\/li>\n<\/ul>\n<p>$ cd myproject<br \/>\n$ git init<br \/>\n$ git add .<br \/>\n$ git commit -m &#039;initial commit&#039;<br \/>\n$ git remote add origin git&#064;gitserver:\/srv\/git\/project.git<br \/>\n$ git push origin master <\/p>\n<h5 id=\"b17ba3bf\">4. \u514b\u9686\u548c\u63a8\u9001\u6539\u52a8<\/h5>\n<ul>\n<li id=\"u6ac3a383\">\u5176\u4ed6\u5f00\u53d1\u8005\u514b\u9686\u4ed3\u5e93\u5e76\u63d0\u4ea4\u6539\u52a8&#xff1a;<\/li>\n<\/ul>\n<p>$ git clone git&#064;gitserver:\/srv\/git\/project.git<br \/>\n$ cd project<br \/>\n$ vim README<br \/>\n$ git commit -am &#039;fix for the README file&#039;<br \/>\n$ git push origin master <\/p>\n<h5 id=\"99d8c7c0\">5. \u9650\u5236 SSH \u8bbf\u95ee\u6743\u9650<\/h5>\n<ul>\n<li id=\"u55a4c9ae\">\u4f7f\u7528 git-shell \u4f5c\u4e3a\u9650\u5236 shell&#xff0c;\u9632\u6b62\u5f00\u53d1\u8005\u83b7\u53d6\u666e\u901a shell \u8bbf\u95ee\u6743\u9650&#xff1a;<\/li>\n<\/ul>\n<p>$ sudo chsh git -s $(which git-shell) <\/p>\n<p id=\"u39ec6569\">\u8fd9\u6837&#xff0c;\u5f00\u53d1\u8005\u53ea\u80fd\u901a\u8fc7 SSH \u6267\u884c Git \u64cd\u4f5c&#xff0c;\u65e0\u6cd5\u8bbf\u95ee\u666e\u901a shell\u3002<\/p>\n<h5 id=\"ffa1a65f\">6. \u914d\u7f6e SSH \u9650\u5236\u9009\u9879<\/h5>\n<ul>\n<li id=\"u4a0ccde5\">\u4e3a\u4e86\u907f\u514d\u5f00\u53d1\u8005\u4f7f\u7528 SSH \u7aef\u53e3\u8f6c\u53d1\u7b49\u529f\u80fd&#xff0c;\u53ef\u4ee5\u5728 authorized_keys \u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u9009\u9879&#xff1a;<\/li>\n<\/ul>\n<p>no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa &#8230; <\/p>\n<h5 id=\"d652d862\">7. \u81ea\u5b9a\u4e49 Git Shell<\/h5>\n<ul>\n<li id=\"u0cf2c9ef\">\u53ef\u4e3a git-shell \u6dfb\u52a0\u81ea\u5b9a\u4e49\u914d\u7f6e\u6765\u9650\u5236 Git \u547d\u4ee4\u6216\u663e\u793a\u81ea\u5b9a\u4e49\u7684\u767b\u5f55\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<hr id=\"Khkuu\" \/>\n<h2 id=\"xlw0h\">Git \u5b88\u62a4\u8fdb\u7a0b<\/h2>\n<h5 id=\"z6J1j\">1. Git \u534f\u8bae\u7b80\u4ecb<\/h5>\n<ul>\n<li id=\"ufcbb5d6f\">Git \u534f\u8bae\u9002\u7528\u4e8e\u4e0d\u9700\u8981\u6388\u6743\u7684\u5feb\u901f\u8bbf\u95ee&#xff0c;\u9002\u5408\u53ea\u8bfb\u9879\u76ee&#xff0c;\u4e14\u4e00\u822c\u65e0\u9700\u914d\u7f6e SSH \u516c\u94a5\u3002\u4f7f\u7528\u6b64\u534f\u8bae\u65f6&#xff0c;\u5185\u5bb9\u4f1a\u66b4\u9732\u7ed9\u6240\u6709\u4eba&#xff0c;\u901a\u5e38\u7528\u4e8e\u516c\u5f00\u7684\u53ea\u8bfb\u9879\u76ee\u6216\u81ea\u52a8\u7cfb\u7edf&#xff08;\u5982 CI\/CD&#xff09;\u3002<\/li>\n<\/ul>\n<h5 id=\"VkGHP\">2. \u542f\u52a8 Git \u5b88\u62a4\u8fdb\u7a0b<\/h5>\n<ul>\n<li id=\"u7bb96184\">\u542f\u52a8 Git \u5b88\u62a4\u8fdb\u7a0b&#xff1a;<\/li>\n<\/ul>\n<p>$ git daemon &#8211;reuseaddr &#8211;base-path&#061;\/srv\/git\/ \/srv\/git\/ <\/p>\n<ul>\n<li>\n<ul>\n<li id=\"u536648d2\">&#8211;reuseaddr&#xff1a;\u5141\u8bb8\u670d\u52a1\u5668\u91cd\u542f\u65f6\u65e0\u9700\u7b49\u5f85\u65e7\u8fde\u63a5\u8d85\u65f6\u3002<\/li>\n<li id=\"u979de730\">&#8211;base-path&#xff1a;\u6307\u5b9a\u4ed3\u5e93\u7684\u57fa\u672c\u8def\u5f84&#xff0c;\u5141\u8bb8\u901a\u8fc7\u7b80\u77ed\u8def\u5f84\u6765\u8bbf\u95ee\u4ed3\u5e93\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h5 id=\"LL8J0\">3. \u9632\u706b\u5899\u914d\u7f6e<\/h5>\n<ul>\n<li id=\"ua76bf91a\">\u9700\u8981\u5f00\u653e 9418 \u7aef\u53e3\u4f9b Git \u5b88\u62a4\u8fdb\u7a0b\u901a\u4fe1\u3002<\/li>\n<\/ul>\n<h5 id=\"DrC4g\">4. \u4f7f\u7528 systemd \u542f\u52a8 Git \u5b88\u62a4\u8fdb\u7a0b<\/h5>\n<ul>\n<li id=\"u78570328\">\u5728 \/etc\/systemd\/system\/git-daemon.service \u6587\u4ef6\u4e2d\u6dfb\u52a0\u670d\u52a1\u914d\u7f6e&#xff1a;<\/li>\n<\/ul>\n<p>[Unit]<br \/>\nDescription&#061;Start Git Daemon<\/p>\n<p>[Service]<br \/>\nExecStart&#061;\/usr\/bin\/git daemon &#8211;reuseaddr &#8211;base-path&#061;\/srv\/git\/ \/srv\/git\/<br \/>\nRestart&#061;always<br \/>\nRestartSec&#061;500ms<br \/>\nStandardOutput&#061;syslog<br \/>\nStandardError&#061;syslog<br \/>\nSyslogIdentifier&#061;git-daemon<br \/>\nUser&#061;git<br \/>\nGroup&#061;git<\/p>\n<p>[Install]<br \/>\nWantedBy&#061;multi-user.target <\/p>\n<ul>\n<li id=\"u2e562514\">\u4f7f\u5176\u5728\u542f\u52a8\u65f6\u81ea\u52a8\u8fd0\u884c\u5e76\u76d1\u63a7\u5b88\u62a4\u8fdb\u7a0b&#xff1a;<\/li>\n<\/ul>\n<p>$ sudo systemctl enable git-daemon<br \/>\n$ sudo systemctl start git-daemon<br \/>\n$ sudo systemctl stop git-daemon <\/p>\n<h5 id=\"TqGZW\">5. \u521b\u5efa git-daemon-export-ok \u6587\u4ef6<\/h5>\n<ul>\n<li id=\"u16bacfd2\">\u8981\u5141\u8bb8\u4ed3\u5e93\u901a\u8fc7 Git \u5b88\u62a4\u8fdb\u7a0b\u8fdb\u884c\u65e0\u6388\u6743\u8bbf\u95ee&#xff0c;\u5728\u4ed3\u5e93\u76ee\u5f55\u4e2d\u521b\u5efa git-daemon-export-ok \u6587\u4ef6&#xff1a;<\/li>\n<\/ul>\n<p>$ cd \/path\/to\/project.git<br \/>\n$ touch git-daemon-export-ok <\/p>\n<p id=\"u71cff6f6\">\u8fd9\u6837&#xff0c;Git \u5b88\u62a4\u8fdb\u7a0b\u5c31\u4f1a\u4e3a\u516c\u5f00\u4ed3\u5e93\u63d0\u4f9b\u65e0\u9700\u6388\u6743\u7684\u8bbf\u95ee\u670d\u52a1\u3002<\/p>\n<hr id=\"kHtvt\" \/>\n<h2 id=\"hQ8JQ\">Smart HTTP<\/h2>\n<h5 id=\"13e4f245\">1. Smart HTTP \u534f\u8bae<\/h5>\n<ul>\n<li id=\"u4601f4bd\">Smart HTTP \u7ed3\u5408\u4e86 SSH \u6388\u6743\u8bbf\u95ee\u548c git:\/\/ \u65e0\u6388\u6743\u8bbf\u95ee&#xff0c;\u5141\u8bb8\u901a\u8fc7 HTTP \u8fdb\u884c\u667a\u80fd\u6216\u54d1\u6a21\u5f0f\u7684 Git \u64cd\u4f5c\u3002<\/li>\n<\/ul>\n<ul>\n<li>\n<ul>\n<li id=\"u6d995f6e\">\u667a\u80fd\u6a21\u5f0f&#xff08;Smart mode&#xff09;&#xff1a;\u9002\u7528\u4e8e\u652f\u6301\u667a\u80fd\u534f\u8bae&#xff08;Git 1.6.6 \u53ca\u4ee5\u4e0a\u7248\u672c\u7684\u5ba2\u6237\u7aef&#xff09;&#xff0c;\u63d0\u4f9b\u66f4\u9ad8\u6548\u7684\u901a\u4fe1\u3002<\/li>\n<li id=\"u791f108d\">\u54d1\u6a21\u5f0f&#xff08;Dumb mode&#xff09;&#xff1a;\u9002\u7528\u4e8e\u8001\u65e7\u7684 Git \u5ba2\u6237\u7aef&#xff0c;\u4e0d\u652f\u6301\u667a\u80fd\u534f\u8bae&#xff0c;\u56de\u843d\u5230\u517c\u5bb9\u6a21\u5f0f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h5 id=\"04f9fad3\">2. \u542f\u7528 Git HTTP \u540e\u7aef<\/h5>\n<ul>\n<li id=\"uf7b6f14a\">\u5728\u670d\u52a1\u5668\u4e0a\u542f\u7528 Git \u7684 git-http-backend CGI \u811a\u672c&#xff0c;\u8be5\u811a\u672c\u5904\u7406\u901a\u8fc7 HTTP \u534f\u8bae\u53d1\u9001\u7684\u8bf7\u6c42&#xff0c;\u5e76\u5224\u65ad\u662f\u5426\u4f7f\u7528\u667a\u80fd\u534f\u8bae\u3002<\/li>\n<\/ul>\n<h5 id=\"1ce5cd75\">3. \u5b89\u88c5 Apache \u53ca\u5fc5\u8981\u6a21\u5757<\/h5>\n<ul>\n<li id=\"u45a8c281\">\u5b89\u88c5 Apache Web \u670d\u52a1\u5668\u5e76\u542f\u7528\u5fc5\u8981\u7684\u6a21\u5757&#xff1a;<\/li>\n<\/ul>\n<p>$ sudo apt-get install apache2 apache2-utils<br \/>\n$ a2enmod cgi alias env <\/p>\n<ul>\n<li id=\"ud448296e\">\u542f\u7528 mod_cgi, mod_alias, \u548c mod_env \u6a21\u5757&#xff0c;\u4f7f\u5176\u652f\u6301 Git HTTP \u8bf7\u6c42\u3002<\/li>\n<\/ul>\n<h5 id=\"d64fb4e7\">4. \u8bbe\u7f6e\u6587\u4ef6\u6743\u9650<\/h5>\n<ul>\n<li id=\"u6d7ea5cb\">\u5c06\u4ed3\u5e93\u7684 Unix \u7528\u6237\u7ec4\u8bbe\u7f6e\u4e3a www-data&#xff0c;\u8ba9 Web \u670d\u52a1\u5668\u53ef\u4ee5\u8bbf\u95ee Git \u4ed3\u5e93&#xff1a;<\/li>\n<\/ul>\n<p>$ chgrp -R www-data \/srv\/git <\/p>\n<h5 id=\"9c30d9d4\">5. \u914d\u7f6e Apache<\/h5>\n<ul>\n<li id=\"ub2932035\">\u5728 Apache \u914d\u7f6e\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9&#xff0c;\u5904\u7406 Git \u8bf7\u6c42&#xff1a;<\/li>\n<\/ul>\n<p>SetEnv GIT_PROJECT_ROOT \/srv\/git<br \/>\nSetEnv GIT_HTTP_EXPORT_ALL<br \/>\nScriptAlias \/git\/ \/usr\/lib\/git-core\/git-http-backend\/ <\/p>\n<ul>\n<li id=\"u0eda4d09\">GIT_HTTP_EXPORT_ALL&#xff1a;\u5f53\u542f\u7528\u65f6&#xff0c;Git \u4f1a\u5bf9\u6240\u6709\u4ed3\u5e93\u63d0\u4f9b HTTP \u8bbf\u95ee&#xff08;\u65e0\u6388\u6743&#xff09;&#xff0c;\u5426\u5219\u53ea\u63d0\u4f9b\u5e26\u6709 git-daemon-export-ok \u6587\u4ef6\u7684\u4ed3\u5e93\u3002<\/li>\n<\/ul>\n<h5 id=\"3e195347\">6. \u8bbe\u7f6e\u6388\u6743\u8bbf\u95ee<\/h5>\n<ul>\n<li id=\"u48a4e359\">\u5982\u679c\u9700\u8981\u5bf9\u5199\u64cd\u4f5c\u8fdb\u884c\u6388\u6743\u63a7\u5236&#xff0c;\u53ef\u4ee5\u5728 Apache \u914d\u7f6e\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u6388\u6743\u8bbe\u7f6e&#xff1a;<\/li>\n<\/ul>\n<p>&lt;Files &#034;git-http-backend&#034;&gt;<br \/>\n    AuthType Basic<br \/>\n    AuthName &#034;Git Access&#034;<br \/>\n    AuthUserFile \/srv\/git\/.htpasswd<br \/>\n    Require expr !(%{QUERY_STRING} -strmatch &#039;*service&#061;git-receive-pack*&#039; || %{REQUEST_URI} &#061;~ m#\/git-receive-pack$#)<br \/>\n    Require valid-user<br \/>\n&lt;\/Files&gt; <\/p>\n<ul>\n<li>\n<ul>\n<li id=\"uea02026b\">\u8fd9\u4f1a\u8981\u6c42\u7528\u6237\u4f7f\u7528\u57fa\u672c\u8ba4\u8bc1\u8fdb\u884c\u6388\u6743&#xff0c;\u9664\u975e\u662f git-receive-pack \u8bf7\u6c42\u3002<\/li>\n<li id=\"u4c0ad60a\">\u4f7f\u7528 htpasswd \u5de5\u5177\u521b\u5efa .htpasswd \u6587\u4ef6\u5e76\u6dfb\u52a0\u7528\u6237&#xff1a;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>$ htpasswd -c \/srv\/git\/.htpasswd schacon <\/p>\n<h5 id=\"67ffd7a0\">7. SSL \u52a0\u5bc6\u4f20\u8f93<\/h5>\n<ul>\n<li id=\"u99c72d09\">\u53ef\u4ee5\u901a\u8fc7\u542f\u7528 SSL \u4fdd\u969c HTTP \u8bf7\u6c42\u7684\u52a0\u5bc6\u4f20\u8f93&#xff0c;\u786e\u4fdd\u5b89\u5168\u3002<\/li>\n<\/ul>\n<h5 id=\"d59a9fd4\">8. Web \u670d\u52a1\u5668\u9009\u62e9<\/h5>\n<ul>\n<li id=\"ub3d9ee17\">\u867d\u7136\u793a\u4f8b\u4e2d\u4f7f\u7528 Apache&#xff0c;\u4f46\u53ea\u8981\u80fd\u5904\u7406 CGI \u811a\u672c\u7684 Web \u670d\u52a1\u5668\u90fd\u53ef\u4ee5\u7528\u6765\u5b9e\u73b0 Smart HTTP\u3002<\/li>\n<\/ul>\n<h5 id=\"27e7c29d\">9. \u76f8\u5173\u94fe\u63a5<\/h5>\n<ul>\n<li id=\"uab3e46fc\">\u82e5\u60f3\u6df1\u5165\u4e86\u89e3 Apache \u914d\u7f6e\u6388\u6743\u8bbf\u95ee\u7684\u4fe1\u606f&#xff0c;\u8bf7\u53c2\u8003 Apache \u6587\u6863\u3002<\/li>\n<\/ul>\n<p id=\"uadcef70e\">\u8fd9\u6837\u914d\u7f6e\u540e&#xff0c;\u4f60\u5c31\u53ef\u4ee5\u901a\u8fc7 Smart HTTP \u534f\u8bae\u4e3a Git \u4ed3\u5e93\u63d0\u4f9b\u9ad8\u6548\u4e14\u5b89\u5168\u7684\u8bbf\u95ee\u3002<\/p>\n<hr id=\"cNjBE\" \/>\n<h2 id=\"PGiAq\">GitWeb<\/h2>\n<p id=\"u4ef85201\">GitWeb \u662f\u4e00\u4e2a\u7528\u4e8e\u5c55\u793a Git \u9879\u76ee\u7684\u7f51\u9875\u754c\u9762&#xff0c;\u901a\u5e38\u901a\u8fc7 CGI \u811a\u672c\u6765\u8fd0\u884c\u3002\u642d\u5efa\u548c\u4f7f\u7528 GitWeb \u7684\u6b65\u9aa4\u5982\u4e0b&#xff1a;<\/p>\n<h3 id=\"mTe6p\">1. \u4e34\u65f6\u542f\u52a8 GitWeb \u670d\u52a1\u5668&#xff1a;<\/h3>\n<ul>\n<li>\n<ul>\n<li id=\"u3360a0c0\">\u5728\u9879\u76ee\u76ee\u5f55\u4e2d\u4f7f\u7528 git instaweb \u547d\u4ee4\u6765\u542f\u52a8\u4e00\u4e2a\u4e34\u65f6\u7684\u7f51\u9875\u670d\u52a1\u5668\u3002\u5982\u679c\u4f7f\u7528 Mac \u7cfb\u7edf&#xff0c;\u53ef\u4ee5\u52a0\u4e0a &#8211;httpd&#061;webrick \u53c2\u6570\u6765\u4f7f\u7528 webrick \u670d\u52a1\u5668&#xff0c;\u9ed8\u8ba4\u76d1\u542c\u7aef\u53e3\u4e3a 1234\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8&#xff1a;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>$ git instaweb &#8211;httpd&#061;webrick <\/p>\n<ul>\n<li>\n<ul>\n<li id=\"ud91712f3\">\u82e5\u8981\u5173\u95ed\u670d\u52a1\u5668&#xff0c;\u53ef\u4ee5\u4f7f\u7528&#xff1a;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>$ git instaweb &#8211;httpd&#061;webrick &#8211;stop <\/p>\n<h3 id=\"r1C2L\">2. \u4e3a\u6301\u7eed\u8bbf\u95ee\u8bbe\u7f6e Web \u670d\u52a1\u5668&#xff1a;<\/h3>\n<ul>\n<li>\n<ul>\n<li id=\"u16502218\">\u5982\u679c\u9700\u8981\u6301\u7eed\u8fd0\u884c GitWeb&#xff0c;\u9700\u901a\u8fc7\u5e38\u89c4\u7684 Web \u670d\u52a1\u5668&#xff08;\u5982 Apache&#xff09;\u6765\u90e8\u7f72 GitWeb\u3002<\/li>\n<li id=\"ud31dd94b\">\u5b89\u88c5 GitWeb&#xff1a;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<li>\n<li>\n<li id=\"u11a867a4\">\u514b\u9686 Git \u6e90\u4ee3\u7801\u5e76\u7f16\u8bd1&#xff1a;<\/li>\n<\/li>\n<\/li>\n<p>$ git clone git:\/\/git.kernel.org\/pub\/scm\/git\/git.git<br \/>\n$ cd git\/<br \/>\n$ make GITWEB_PROJECTROOT&#061;&#034;\/srv\/git&#034; prefix&#061;\/usr gitweb <\/p>\n<li>\n<li>\n<li id=\"u0ab83a78\">\u5c06\u751f\u6210\u7684 GitWeb \u6587\u4ef6\u590d\u5236\u5230 Web \u670d\u52a1\u5668\u7684\u6839\u76ee\u5f55&#xff1a;<\/li>\n<\/li>\n<\/li>\n<p>$ sudo cp -Rf gitweb \/var\/www\/ <\/p>\n<ul>\n<li>\n<ul>\n<li id=\"u37d99682\">\u914d\u7f6e Apache \u865a\u62df\u4e3b\u673a\u4ee5\u652f\u6301 CGI \u811a\u672c&#xff1a;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&lt;VirtualHost *:80&gt;<br \/>\n    ServerName gitserver<br \/>\n    DocumentRoot \/var\/www\/gitweb<br \/>\n    &lt;Directory \/var\/www\/gitweb&gt;<br \/>\n        Options &#043;ExecCGI &#043;FollowSymLinks &#043;SymLinksIfOwnerMatch<br \/>\n        AllowOverride All<br \/>\n        Order allow,deny<br \/>\n        Allow from all<br \/>\n        AddHandler cgi-script cgi<br \/>\n        DirectoryIndex gitweb.cgi<br \/>\n    &lt;\/Directory&gt;<br \/>\n&lt;\/VirtualHost&gt; <\/p>\n<h3 id=\"D0LEq\">3. \u8bbf\u95ee GitWeb&#xff1a;<\/h3>\n<ul>\n<li>\n<ul>\n<li id=\"ue26d3d69\">\u914d\u7f6e\u5b8c\u6210\u540e&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u8bbf\u95ee http:\/\/gitserver\/ \u6765\u67e5\u770b\u4f60\u7684 Git \u9879\u76ee\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p id=\"uf86bf302\">\u901a\u8fc7\u8fd9\u4e9b\u6b65\u9aa4&#xff0c;\u4f60\u53ef\u4ee5\u4f7f\u7528 GitWeb \u4e3a\u4f60\u7684\u56e2\u961f\u6216\u5f00\u6e90\u9879\u76ee\u63d0\u4f9b\u4e00\u4e2a\u7f51\u9875\u67e5\u770b\u754c\u9762\u3002<\/p>\n<hr id=\"vg6B8\" \/>\n<h2 id=\"GdmVC\">GitLab<\/h2>\n<p id=\"ua2658cbe\">GitLab \u662f\u4e00\u4e2a\u529f\u80fd\u5168\u9762\u7684 Git \u670d\u52a1\u5668&#xff0c;\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u534f\u4f5c\u548c\u9879\u76ee\u7ba1\u7406\u529f\u80fd\u3002\u5176\u5b89\u88c5\u548c\u4f7f\u7528\u8fc7\u7a0b\u8f83\u4e3a\u590d\u6742&#xff0c;\u6d89\u53ca\u5230\u6570\u636e\u5e93\u652f\u6301&#xff0c;\u4f46\u63d0\u4f9b\u4e86\u8be6\u7ec6\u7684\u6587\u6863\u548c\u652f\u6301&#xff0c;\u4e0b\u9762\u662f\u5b89\u88c5\u548c\u7ba1\u7406 GitLab \u7684\u5173\u952e\u6b65\u9aa4&#xff1a;<\/p>\n<h4 id=\"6b69c0fd\">\u5b89\u88c5 GitLab<\/h4>\n<li id=\"u7b256778\">\u5feb\u901f\u542f\u52a8&#xff1a;\u53ef\u4ee5\u901a\u8fc7\u4e0b\u8f7d\u865a\u62df\u673a\u955c\u50cf\u6216\u4f7f\u7528 Bitnami \u63d0\u4f9b\u7684\u4e00\u952e\u5b89\u88c5\u5305\u6765\u5feb\u901f\u542f\u52a8\u3002<\/li>\n<ul>\n<li>\n<ul>\n<li id=\"u0847bc42\">Bitnami GitLab&#xff1a;\u63d0\u4f9b\u4e86\u767b\u5f55\u754c\u9762&#xff0c;\u53ef\u4ee5\u65b9\u4fbf\u5730\u83b7\u53d6 GitLab \u7684 IP \u5730\u5740\u53ca\u9ed8\u8ba4\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801\u3002<\/li>\n<li id=\"uf23b0ab1\">GitLab \u793e\u533a\u7248&#xff1a;\u901a\u8fc7\u5b98\u65b9\u6587\u6863&#xff08;GitLab \u793e\u533a\u7248 GitHub \u4ed3\u5e93&#xff09;\u8fdb\u884c\u5b89\u88c5&#xff0c;\u652f\u6301\u5728 DigitalOcean \u4e0a\u8fd0\u884c\u865a\u62df\u673a&#xff0c;\u6216\u4f7f\u7528 RPM \u548c DEB \u5305\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4 id=\"6d01a159\">\u7ba1\u7406 GitLab<\/h4>\n<li id=\"u70666fe3\">\u767b\u5f55&#xff1a;\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee\u5b89\u88c5\u597d\u7684 GitLab \u4e3b\u673a&#xff0c;\u4f7f\u7528\u9ed8\u8ba4\u7528\u6237\u540d admin&#064;local.host \u548c\u5bc6\u7801 5iveL!fe \u767b\u5f55\u3002<\/li>\n<li id=\"uefa14aa6\">\u7ba1\u7406\u754c\u9762&#xff1a;\u767b\u5f55\u540e\u53ef\u4ee5\u901a\u8fc7\u70b9\u51fb\u754c\u9762\u4e0a\u7684\u201cAdmin area\u201d\u56fe\u6807\u8fdb\u5165\u7ba1\u7406\u754c\u9762&#xff0c;\u8fdb\u884c\u5404\u79cd\u7ba1\u7406\u64cd\u4f5c\u3002<\/li>\n<h4 id=\"9ec85ef5\">\u7528\u6237\u548c\u6743\u9650\u7ba1\u7406<\/h4>\n<li id=\"uadd6a701\">\u7528\u6237\u8d26\u53f7&#xff1a;\u6bcf\u4e2a\u7528\u6237\u6709\u4e00\u4e2a\u547d\u540d\u7a7a\u95f4&#xff0c;\u8868\u793a\u5176\u9879\u76ee\u7684\u96c6\u5408\u3002\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u8be5\u547d\u540d\u7a7a\u95f4\u8bbf\u95ee\u5176\u62e5\u6709\u7684\u9879\u76ee\u3002<\/li>\n<li id=\"u95acb562\">\u79fb\u9664\u7528\u6237&#xff1a;<\/li>\n<ul>\n<li>\n<ul>\n<li id=\"u355ddb17\">\u5c4f\u853d\u7528\u6237&#xff1a;\u963b\u6b62\u767b\u5f55&#xff0c;\u4f46\u4fdd\u7559\u6570\u636e\u3002<\/li>\n<li id=\"u6cffc468\">\u9500\u6bc1\u7528\u6237&#xff1a;\u5f7b\u5e95\u5220\u9664\u7528\u6237\u53ca\u5176\u6570\u636e\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<li id=\"u50f10485\">\u7ec4&#xff1a;\u591a\u4e2a\u9879\u76ee\u7684\u96c6\u5408&#xff0c;\u7ec4\u5185\u7528\u6237\u6709\u4e0d\u540c\u6743\u9650\u7ea7\u522b&#xff0c;\u4ece\u201c\u8bbf\u5ba2\u201d\u5230\u201c\u62e5\u6709\u8005\u201d&#xff0c;\u51b3\u5b9a\u5176\u8bbf\u95ee\u9879\u76ee\u7684\u6743\u9650\u3002<\/li>\n<h4 id=\"436367b0\">\u9879\u76ee\u7ba1\u7406<\/h4>\n<li id=\"u1eb0e3d8\">\u9879\u76ee&#xff1a;GitLab \u4e2d\u7684\u9879\u76ee\u7b49\u540c\u4e8e Git \u7248\u672c\u5e93&#xff0c;\u5c5e\u4e8e\u7528\u6237\u6216\u7ec4\u7684\u547d\u540d\u7a7a\u95f4\u3002\u9879\u76ee\u53ef\u4ee5\u8bbe\u7f6e\u4e3a\u79c1\u6709\u3001\u5185\u90e8\u6216\u516c\u5f00&#xff0c;\u63a7\u5236\u8bbf\u95ee\u6743\u9650\u3002<\/li>\n<li id=\"u9c391f93\">\u94a9\u5b50&#xff1a;\u652f\u6301\u5728\u9879\u76ee\u548c\u7cfb\u7edf\u7ea7\u522b\u914d\u7f6e\u94a9\u5b50&#xff0c;\u81ea\u52a8\u5316\u8fde\u63a5\u5176\u4ed6\u5f00\u53d1\u5de5\u5177&#xff08;\u5982 CI \u670d\u52a1\u5668&#xff09;\u3002<\/li>\n<h4 id=\"ac4db4ff\">\u534f\u4f5c\u4e0e\u8d21\u732e<\/h4>\n<li id=\"u5eeb2cd1\">\u521b\u5efa\u9879\u76ee&#xff1a;\u901a\u8fc7\u70b9\u51fb\u201c&#043;\u201d\u56fe\u6807\u521b\u5efa\u65b0\u9879\u76ee&#xff0c;\u586b\u5199\u9879\u76ee\u540d\u79f0\u3001\u547d\u540d\u7a7a\u95f4\u53ca\u53ef\u89c6\u7ea7\u522b\u3002<\/li>\n<li id=\"ufbb92915\">\u534f\u4f5c\u8005&#xff1a;\u4e3a\u9879\u76ee\u6dfb\u52a0\u534f\u4f5c\u8005\u5e76\u6307\u5b9a\u8bbf\u95ee\u7ea7\u522b&#xff08;\u5982\u201cDeveloper\u201d&#xff09;&#xff0c;\u5141\u8bb8\u5176\u8fdb\u884c\u4ee3\u7801\u63d0\u4ea4\u3002<\/li>\n<li id=\"u80045bd9\">\u5408\u5e76\u8bf7\u6c42&#xff1a;\u5141\u8bb8\u534f\u4f5c\u8005\u901a\u8fc7\u5206\u652f\u548c\u5408\u5e76\u8bf7\u6c42\u5411\u4e3b\u9879\u76ee\u8d21\u732e\u4ee3\u7801&#xff0c;\u652f\u6301\u4ee3\u7801\u5ba1\u67e5\u3002<\/li>\n<h4 id=\"9ffa8933\">\u5176\u4ed6\u529f\u80fd<\/h4>\n<ul>\n<li id=\"u44443331\">Wiki&#xff1a;\u6bcf\u4e2a\u9879\u76ee\u53ef\u4ee5\u6709\u4e00\u4e2a Wiki&#xff0c;\u7528\u4e8e\u6587\u6863\u548c\u9879\u76ee\u8bf4\u660e\u3002<\/li>\n<li id=\"ude0fe48b\">\u65e5\u5e38\u7ba1\u7406&#xff1a;GitLab \u7684\u5927\u90e8\u5206\u7ba1\u7406\u64cd\u4f5c\u53ef\u4ee5\u901a\u8fc7 Web \u754c\u9762\u8fdb\u884c&#xff0c;\u65e0\u9700\u9891\u7e41\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<p id=\"uc15f7a38\">GitLab \u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u7248\u672c\u63a7\u5236\u3001\u56e2\u961f\u534f\u4f5c\u548c\u9879\u76ee\u7ba1\u7406\u529f\u80fd&#xff0c;\u9002\u5408\u4e2d\u5230\u5927\u578b\u5f00\u53d1\u56e2\u961f\u4f7f\u7528\u3002<\/p>\n<hr id=\"m1wlX\" \/>\n<h2 id=\"dLXKJ\">\u7b2c\u4e09\u65b9\u6258\u7ba1\u7684\u9009\u62e9<\/h2>\n<p id=\"u2666469d\">\u7b2c\u4e09\u65b9\u6258\u7ba1\u670d\u52a1\u4e3a Git \u9879\u76ee\u63d0\u4f9b\u4e86\u4fbf\u6377\u7684\u6258\u7ba1\u9009\u9879&#xff0c;\u907f\u514d\u4e86\u81ea\u5df1\u7ef4\u62a4\u670d\u52a1\u5668\u7684\u9ebb\u70e6&#xff0c;\u5e76\u63d0\u4f9b\u4e86\u4e00\u4e9b\u989d\u5916\u7684\u597d\u5904&#xff0c;\u7279\u522b\u662f\u5728\u5f00\u6e90\u793e\u533a\u7684\u66dd\u5149\u5ea6\u548c\u534f\u4f5c\u65b9\u9762\u3002\u4ee5\u4e0b\u662f\u9009\u62e9\u7b2c\u4e09\u65b9\u6258\u7ba1\u670d\u52a1\u7684\u4e00\u4e9b\u8981\u70b9&#xff1a;<\/p>\n<h4 id=\"5704918d\">\u7b2c\u4e09\u65b9\u6258\u7ba1\u7684\u4f18\u52bf&#xff1a;<\/h4>\n<li id=\"u5f712a47\">\u5feb\u901f\u5f00\u59cb&#xff1a;\u65e0\u9700\u8bbe\u7acb\u548c\u7ef4\u62a4\u81ea\u5df1\u7684 Git \u670d\u52a1\u5668&#xff0c;\u53ef\u4ee5\u76f4\u63a5\u5c06\u9879\u76ee\u6258\u7ba1\u5230\u4e13\u4e1a\u5e73\u53f0\u3002<\/li>\n<li id=\"u6697ea5d\">\u7ef4\u62a4\u8f7b\u677e&#xff1a;\u6258\u7ba1\u670d\u52a1\u63d0\u4f9b\u4e86\u57fa\u7840\u8bbe\u65bd\u548c\u76d1\u63a7&#xff0c;\u4e0d\u9700\u8981\u81ea\u5df1\u5904\u7406\u8fd9\u4e9b\u95ee\u9898\u3002<\/li>\n<li id=\"u8b9163d8\">\u5f00\u6e90\u66dd\u5149&#xff1a;\u901a\u8fc7\u516c\u5171\u6258\u7ba1\u5e73\u53f0&#xff08;\u5982 GitHub&#xff09;\u6258\u7ba1\u5f00\u6e90\u9879\u76ee&#xff0c;\u53ef\u4ee5\u8ba9\u66f4\u591a\u7684\u4eba\u53d1\u73b0\u5e76\u53c2\u4e0e\u9879\u76ee&#xff0c;\u5e2e\u52a9\u9879\u76ee\u66f4\u5feb\u6210\u957f\u3002<\/li>\n<h4 id=\"4a4950bc\">\u6258\u7ba1\u5e73\u53f0\u9009\u62e9&#xff1a;<\/h4>\n<ul>\n<li id=\"u906a98d8\">\u5e02\u9762\u4e0a\u6709\u8bb8\u591a Git \u6258\u7ba1\u5e73\u53f0&#xff0c;\u5404\u5e73\u53f0\u63d0\u4f9b\u4e0d\u540c\u7684\u529f\u80fd\u3001\u754c\u9762\u548c\u6743\u9650\u63a7\u5236\u3002<\/li>\n<li id=\"u7cc50144\">\u53ef\u4ee5\u6839\u636e\u9879\u76ee\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5e73\u53f0\u3002<\/li>\n<li id=\"uda2d3eb8\">GitHub \u662f\u5f53\u524d\u6700\u5927\u7684 Git \u6258\u7ba1\u5e73\u53f0&#xff0c;\u5e7f\u6cdb\u7528\u4e8e\u5f00\u6e90\u9879\u76ee&#xff0c;\u5e76\u4e14\u63d0\u4f9b\u5f3a\u5927\u7684\u534f\u4f5c\u5de5\u5177&#xff0c;\u5982 Pull Request \u548c Issue \u8ddf\u8e2a\u3002<\/li>\n<\/ul>\n<h4 id=\"4e966f22\">\u63a8\u8350&#xff1a;<\/h4>\n<ul>\n<li id=\"u6fb29d38\">\u5982\u679c\u4f60\u5e0c\u671b\u628a\u5f00\u6e90\u4ee3\u7801\u6258\u7ba1\u7ed9\u66f4\u591a\u5f00\u53d1\u8005\u53d1\u73b0\u548c\u8d21\u732e&#xff0c;\u9009\u62e9\u4e00\u4e2a\u516c\u5171\u7684\u6258\u7ba1\u5e73\u53f0&#xff08;\u5982 GitHub&#xff09;\u662f\u4e00\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\u3002<\/li>\n<li id=\"ud7b10dd1\">\u5373\u4f7f\u4f60\u5df2\u7ecf\u6709\u81ea\u5df1\u7684 Git \u670d\u52a1\u5668&#xff0c;\u4ecd\u7136\u53ef\u4ee5\u5c06\u5f00\u6e90\u9879\u76ee\u6258\u7ba1\u5230\u8fd9\u4e9b\u7b2c\u4e09\u65b9\u5e73\u53f0&#xff0c;\u4ece\u800c\u63d0\u9ad8\u9879\u76ee\u7684\u53ef\u89c1\u5ea6\u548c\u53c2\u4e0e\u5ea6\u3002<\/li>\n<\/ul>\n<p id=\"u4b649883\">\u53ef\u4ee5\u67e5\u770b Git \u7ef4\u57fa\u7684 GitHosting \u9875\u9762 \u83b7\u53d6\u66f4\u591a\u6258\u7ba1\u5e73\u53f0\u7684\u4fe1\u606f\u3002<\/p>\n<hr id=\"BL0ao\" \/>\n<h2 id=\"t4936\">\u603b\u7ed3<\/h2>\n<p id=\"u193ddfe8\">\u8fdc\u7a0b\u5b58\u53d6 Git \u4ed3\u5e93\u63d0\u4f9b\u4e86\u591a\u79cd\u9009\u62e9&#xff0c;\u65b9\u4fbf\u4e0e\u5176\u4ed6\u4eba\u5408\u4f5c\u6216\u5206\u4eab\u5de5\u4f5c\u3002\u9009\u62e9\u6258\u7ba1\u670d\u52a1\u5668\u6216\u81ea\u884c\u8fd0\u884c\u670d\u52a1\u5668\u90fd\u6709\u5404\u81ea\u7684\u4f18\u7f3a\u70b9&#xff0c;\u9002\u5408\u4e0d\u540c\u7684\u9700\u6c42\u548c\u73af\u5883&#xff1a;<\/p>\n<h4 id=\"e3cfffad\">\u9009\u62e9\u8fdc\u7a0b\u5b58\u53d6 Git \u4ed3\u5e93\u7684\u65b9\u5f0f&#xff1a;<\/h4>\n<li id=\"u2dbbfbe9\">\u81ea\u884c\u8fd0\u884c\u670d\u52a1\u5668&#xff1a;<\/li>\n<ul>\n<li>\n<ul>\n<li id=\"uf61741ae\">\u4f18\u70b9&#xff1a;\u53ef\u4ee5\u5b8c\u5168\u638c\u63a7\u6743\u9650\u548c\u914d\u7f6e&#xff0c;\u4ed3\u5e93\u6570\u636e\u5728\u81ea\u5df1\u7684\u9632\u706b\u5899\u5185&#xff0c;\u66f4\u6709\u63a7\u5236\u6743\u3002<\/li>\n<li id=\"u8f295369\">\u7f3a\u70b9&#xff1a;\u9700\u8981\u6295\u5165\u5927\u91cf\u65f6\u95f4\u548c\u7cbe\u529b\u8fdb\u884c\u670d\u52a1\u5668\u8bbe\u7f6e\u3001\u7ef4\u62a4\u548c\u76d1\u63a7\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<li id=\"u990f551c\">\u4f7f\u7528\u7b2c\u4e09\u65b9\u6258\u7ba1\u670d\u52a1\u5668&#xff1a;<\/li>\n<ul>\n<li>\n<ul>\n<li id=\"u4922b5be\">\u4f18\u70b9&#xff1a;\u6613\u4e8e\u8bbe\u7f6e\u548c\u7ef4\u62a4&#xff0c;\u65e0\u9700\u5173\u6ce8\u57fa\u7840\u8bbe\u65bd\u7ba1\u7406\u3002\u9002\u5408\u5feb\u901f\u542f\u52a8\u548c\u5171\u4eab\u9879\u76ee&#xff0c;\u5c24\u5176\u662f\u5f00\u6e90\u9879\u76ee\u3002<\/li>\n<li id=\"ua3c472b6\">\u7f3a\u70b9&#xff1a;\u4f9d\u8d56\u7b2c\u4e09\u65b9\u670d\u52a1&#xff0c;\u53ef\u80fd\u4f1a\u9047\u5230\u8bbf\u95ee\u9650\u5236\u6216\u5b89\u5168\u62c5\u5fe7&#xff0c;\u67d0\u4e9b\u7ec4\u7ec7\u53ef\u80fd\u4e0d\u5141\u8bb8\u5c06\u4ee3\u7801\u5b58\u653e\u5728\u5916\u90e8\u670d\u52a1\u5668\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4 id=\"321504f9\">\u51b3\u5b9a\u56e0\u7d20&#xff1a;<\/h4>\n<ul>\n<li id=\"u814b3c78\">\u5982\u679c\u5b89\u5168\u6027\u548c\u5b8c\u5168\u63a7\u5236\u5bf9\u4f60\u5f88\u91cd\u8981&#xff0c;\u4e14\u80fd\u6295\u5165\u8db3\u591f\u7684\u8d44\u6e90\u6765\u7ef4\u62a4\u670d\u52a1\u5668&#xff0c;\u53ef\u80fd\u4f1a\u9009\u62e9\u81ea\u5df1\u642d\u5efa Git \u670d\u52a1\u5668\u3002<\/li>\n<li id=\"u96627e15\">\u5982\u679c\u4fbf\u6377\u6027\u548c\u5feb\u901f\u542f\u52a8\u662f\u9996\u8981\u8003\u8651&#xff0c;\u4e14\u53ef\u4ee5\u63a5\u53d7\u5c06\u4ee3\u7801\u5b58\u50a8\u5728\u5916\u90e8\u670d\u52a1\u5668&#xff0c;\u90a3\u4e48\u4f7f\u7528\u6258\u7ba1\u670d\u52a1&#xff08;\u5982 GitHub\u3001GitLab&#xff09;\u662f\u66f4\u4e3a\u4fbf\u6377\u7684\u9009\u62e9\u3002<\/li>\n<\/ul>\n<p id=\"u83001b81\">\u5728\u9009\u62e9\u65f6&#xff0c;\u7ec4\u7ec7\u7684\u5b89\u5168\u7b56\u7565\u548c\u8d44\u6e90\u80fd\u529b\u662f\u5173\u952e\u51b3\u7b56\u56e0\u7d20\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb905\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf8\u6b21\u3002\u4f5c\u7528\uff1a\u63d0\u4f9b\u534f\u4f5c\u5e73\u53f0\uff0c\u652f\u6301\u56e2\u961f\u5171\u4eab\u4ee3\u7801\uff0c\u5373\u4f7f\u4e3b\u673a\u79bb\u7ebf\uff0c\u5176\u4ed6\u4eba\u4ecd\u53ef\u8bbf\u95ee\u3002\u5e38\u89c1\u5f62\u5f0f\uff1a\u88f8\u4ed3\u5e93\uff08\u4e0d\u542b\u5de5\u4f5c\u76ee\u5f55\uff0c\u4ec5\u4fdd\u5b58Git\u5143\u6570\u636e\uff09\u3002\u672c\u5730\u534f\u8bae\uff1a\u9002\u5408\u56e2\u961f\u5728\u5171\u4eab\u6587\u4ef6\u7cfb\u7edf\u4e0a\u4f7f\u7528\uff0c\u4f46\u5c40\u9650\u4e8e\u5355\u4e00\u7f51\u7edc\u73af\u5883\u3002HTTP\/HTTPS\u534f\u8bae\uff1a\u63a8\u8350\u667a\u80fdHTTP\uff0c\u9002\u5408\u7edd\u5927\u591a\u6570\u56e2\u961f\u534f\u4f5c\u573a\u666f\u3002SSH\u534f\u8bae\uff1a\u9002\u5408\u4f01\u4e1a\u5185\u90e8\u4f7f\u7528\uff0c\u5b89\u5168\u4e14\u9ad8\u6548\u3002Git\u534f\u8bae\uff1a\u9002\u5408\u63d0\u4f9b\u9ad8\u6548\u53ea\u8bfb\u8bbf\u95ee\uff0c\u4f46\u4e0d\u9002\u7528\u4e8e\u9700\u8981\u6388\u6743\u63a7\u5236\u7684\u573a\u666f\u3002\u9009\u62e9\u534f\u8bae\u65f6\uff0c\u53ef\u6839\u636e\u534f\u4f5c\u9700\u6c42\u3001\u8bbf\u95ee\u573a\u666f\u3001\u5b89\u5168\u6027\u548c\u914d\u7f6e\u96be\u5ea6\u8fdb\u884c\u6743\u8861\u3002_git\u670d\u52a1\u5668\u7684\u4f5c\u7528<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[89,292,725,43,726],"topic":[],"class_list":{"0":"post-12748","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-server","7":"tag-git","8":"tag-292","10":"tag-43","11":"tag-726"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u56fe\u89e3Git\u2014\u2014\u670d\u52a1\u5668\u4e0a\u7684Git\u300aPro Git\u300b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/12748.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u56fe\u89e3Git\u2014\u2014\u670d\u52a1\u5668\u4e0a\u7684Git\u300aPro Git\u300b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb905\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf8\u6b21\u3002\u4f5c\u7528\uff1a\u63d0\u4f9b\u534f\u4f5c\u5e73\u53f0\uff0c\u652f\u6301\u56e2\u961f\u5171\u4eab\u4ee3\u7801\uff0c\u5373\u4f7f\u4e3b\u673a\u79bb\u7ebf\uff0c\u5176\u4ed6\u4eba\u4ecd\u53ef\u8bbf\u95ee\u3002\u5e38\u89c1\u5f62\u5f0f\uff1a\u88f8\u4ed3\u5e93\uff08\u4e0d\u542b\u5de5\u4f5c\u76ee\u5f55\uff0c\u4ec5\u4fdd\u5b58Git\u5143\u6570\u636e\uff09\u3002\u672c\u5730\u534f\u8bae\uff1a\u9002\u5408\u56e2\u961f\u5728\u5171\u4eab\u6587\u4ef6\u7cfb\u7edf\u4e0a\u4f7f\u7528\uff0c\u4f46\u5c40\u9650\u4e8e\u5355\u4e00\u7f51\u7edc\u73af\u5883\u3002HTTP\/HTTPS\u534f\u8bae\uff1a\u63a8\u8350\u667a\u80fdHTTP\uff0c\u9002\u5408\u7edd\u5927\u591a\u6570\u56e2\u961f\u534f\u4f5c\u573a\u666f\u3002SSH\u534f\u8bae\uff1a\u9002\u5408\u4f01\u4e1a\u5185\u90e8\u4f7f\u7528\uff0c\u5b89\u5168\u4e14\u9ad8\u6548\u3002Git\u534f\u8bae\uff1a\u9002\u5408\u63d0\u4f9b\u9ad8\u6548\u53ea\u8bfb\u8bbf\u95ee\uff0c\u4f46\u4e0d\u9002\u7528\u4e8e\u9700\u8981\u6388\u6743\u63a7\u5236\u7684\u573a\u666f\u3002\u9009\u62e9\u534f\u8bae\u65f6\uff0c\u53ef\u6839\u636e\u534f\u4f5c\u9700\u6c42\u3001\u8bbf\u95ee\u573a\u666f\u3001\u5b89\u5168\u6027\u548c\u914d\u7f6e\u96be\u5ea6\u8fdb\u884c\u6743\u8861\u3002_git\u670d\u52a1\u5668\u7684\u4f5c\u7528\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/12748.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T11:47:55+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/12748.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/12748.html\",\"name\":\"\u56fe\u89e3Git\u2014\u2014\u670d\u52a1\u5668\u4e0a\u7684Git\u300aPro Git\u300b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T11:47:55+00:00\",\"dateModified\":\"2025-04-18T11:47:55+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/12748.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/12748.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/12748.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u56fe\u89e3Git\u2014\u2014\u670d\u52a1\u5668\u4e0a\u7684Git\u300aPro Git\u300b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u56fe\u89e3Git\u2014\u2014\u670d\u52a1\u5668\u4e0a\u7684Git\u300aPro Git\u300b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/12748.html","og_locale":"zh_CN","og_type":"article","og_title":"\u56fe\u89e3Git\u2014\u2014\u670d\u52a1\u5668\u4e0a\u7684Git\u300aPro Git\u300b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb905\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf8\u6b21\u3002\u4f5c\u7528\uff1a\u63d0\u4f9b\u534f\u4f5c\u5e73\u53f0\uff0c\u652f\u6301\u56e2\u961f\u5171\u4eab\u4ee3\u7801\uff0c\u5373\u4f7f\u4e3b\u673a\u79bb\u7ebf\uff0c\u5176\u4ed6\u4eba\u4ecd\u53ef\u8bbf\u95ee\u3002\u5e38\u89c1\u5f62\u5f0f\uff1a\u88f8\u4ed3\u5e93\uff08\u4e0d\u542b\u5de5\u4f5c\u76ee\u5f55\uff0c\u4ec5\u4fdd\u5b58Git\u5143\u6570\u636e\uff09\u3002\u672c\u5730\u534f\u8bae\uff1a\u9002\u5408\u56e2\u961f\u5728\u5171\u4eab\u6587\u4ef6\u7cfb\u7edf\u4e0a\u4f7f\u7528\uff0c\u4f46\u5c40\u9650\u4e8e\u5355\u4e00\u7f51\u7edc\u73af\u5883\u3002HTTP\/HTTPS\u534f\u8bae\uff1a\u63a8\u8350\u667a\u80fdHTTP\uff0c\u9002\u5408\u7edd\u5927\u591a\u6570\u56e2\u961f\u534f\u4f5c\u573a\u666f\u3002SSH\u534f\u8bae\uff1a\u9002\u5408\u4f01\u4e1a\u5185\u90e8\u4f7f\u7528\uff0c\u5b89\u5168\u4e14\u9ad8\u6548\u3002Git\u534f\u8bae\uff1a\u9002\u5408\u63d0\u4f9b\u9ad8\u6548\u53ea\u8bfb\u8bbf\u95ee\uff0c\u4f46\u4e0d\u9002\u7528\u4e8e\u9700\u8981\u6388\u6743\u63a7\u5236\u7684\u573a\u666f\u3002\u9009\u62e9\u534f\u8bae\u65f6\uff0c\u53ef\u6839\u636e\u534f\u4f5c\u9700\u6c42\u3001\u8bbf\u95ee\u573a\u666f\u3001\u5b89\u5168\u6027\u548c\u914d\u7f6e\u96be\u5ea6\u8fdb\u884c\u6743\u8861\u3002_git\u670d\u52a1\u5668\u7684\u4f5c\u7528","og_url":"https:\/\/www.wsisp.com\/helps\/12748.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T11:47:55+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/12748.html","url":"https:\/\/www.wsisp.com\/helps\/12748.html","name":"\u56fe\u89e3Git\u2014\u2014\u670d\u52a1\u5668\u4e0a\u7684Git\u300aPro Git\u300b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T11:47:55+00:00","dateModified":"2025-04-18T11:47:55+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/12748.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/12748.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/12748.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u56fe\u89e3Git\u2014\u2014\u670d\u52a1\u5668\u4e0a\u7684Git\u300aPro Git\u300b"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/12748","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=12748"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/12748\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=12748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=12748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=12748"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=12748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}