{"id":32736,"date":"2023-05-14T06:11:37","date_gmt":"2023-05-13T22:11:37","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=32736"},"modified":"2023-05-14T06:11:37","modified_gmt":"2023-05-13T22:11:37","slug":"build-git-server","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/build-git-server.html","title":{"rendered":"\u5982\u4f55\u642d\u5efa\u4f60\u81ea\u5df1\u7684 Git \u670d\u52a1\u5668\u5462\uff1f"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u73b0\u5728\u6211\u4eec\u5c06\u8981\u5b66\u4e60\u5982\u4f55\u642d\u5efa git \u670d\u52a1\u5668\uff0c\u5982\u4f55\u7f16\u5199\u81ea\u5b9a\u4e49\u7684 Git \u94a9\u5b50\u6765\u5728\u7279\u5b9a\u7684\u4e8b\u4ef6\u89e6\u53d1\u76f8\u5e94\u7684\u52a8\u4f5c\uff08\u4f8b\u5982\u901a\u77e5\uff09\uff0c\u6216\u8005\u662f\u53d1\u5e03\u4f60\u7684\u4ee3\u7801\u5230\u4e00\u4e2a\u7ad9\u70b9\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u76f4\u5230\u73b0\u5728\uff0c\u6211\u4eec\u4e3b\u8981\u8ba8\u8bba\u7684\u8fd8\u662f\u4ee5\u4e00\u4e2a\u4f7f\u7528\u8005\u7684\u8eab\u4efd\u4e0e Git \u8fdb\u884c\u4ea4\u4e92\u3002\u8fd9\u7bc7\u6587\u7ae0\u4e2d\u6211\u5c06\u8ba8\u8bba Git \u7684\u7ba1\u7406\uff0c\u5e76\u4e14\u8bbe\u8ba1\u4e00\u4e2a\u7075\u6d3b\u7684 Git \u6846\u67b6\u3002\u4f60\u53ef\u80fd\u4f1a\u89c9\u5f97\u8fd9\u542c\u8d77\u6765\u662f \u201c\u9ad8\u9636 Git \u6280\u672f\u201d \u6216\u8005 \u201c\u53ea\u6709\u72c2\u70ed\u7c89\u624d\u80fd\u9605\u8bfb\u201d\u7684\u4e00\u53e5\u59d4\u5a49\u7684\u8bf4\u6cd5\uff0c\u4f46\u662f\u4e8b\u5b9e\u662f\u8fd9\u91cc\u9762\u7684\u6bcf\u4e2a\u4efb\u52a1\u90fd\u4e0d\u9700\u8981\u5f88\u6df1\u7684\u77e5\u8bc6\u6216\u8005\u5176\u4ed6\u7279\u6b8a\u7684\u8bad\u7ec3\uff0c\u5c31\u80fd\u57fa\u672c\u7406\u89e3 Git \u7684\u5de5\u4f5c\u539f\u7406\uff0c\u6709\u53ef\u80fd\u9700\u8981\u4e00\u4e01\u70b9\u5173\u4e8e Linux \u7684\u77e5\u8bc6\u3002<\/p>\n

\u5171\u4eab Git \u670d\u52a1\u5668<\/strong><\/div>\n

\u521b\u5efa\u4f60\u81ea\u5df1\u7684\u5171\u4eab Git \u670d\u52a1\u5668\u610f\u5916\u5730\u7b80\u5355\uff0c\u800c\u4e14\u5728\u5f88\u591a\u60c5\u51b5\u4e0b\uff0c\u9047\u5230\u7684\u8fd9\u70b9\u9ebb\u70e6\u662f\u5b8c\u5168\u503c\u5f97\u7684\u3002\u4e0d\u4ec5\u4ec5\u662f\u56e0\u4e3a\u5b83\u4fdd\u8bc1\u4f60\u6709\u6743\u9650\u67e5\u770b\u81ea\u5df1\u7684\u4ee3\u7801\uff0c\u5b83\u8fd8\u53ef\u4ee5\u901a\u8fc7\u6269\u5c55\u4e3a Git \u7684\u4f7f\u7528\u655e\u5f00\u4e86\u4e00\u6247\u5927\u95e8\uff0c\u4f8b\u5982\u4e2a\u4eba Git \u94a9\u5b50\u3001\u65e0\u9650\u5236\u7684\u6570\u636e\u5b58\u50a8\u3001\u548c\u6301\u7eed\u96c6\u6210\u4e0e\u5206\u53d1\uff08CI & CD\uff09\u3002<\/p>\n

\u5982\u679c\u4f60\u77e5\u9053\u5982\u4f55\u4f7f\u7528 Git \u548c SSH\uff0c\u90a3\u4e48\u4f60\u5df2\u7ecf\u77e5\u9053\u600e\u4e48\u521b\u5efa\u4e00\u4e2a Git \u670d\u52a1\u5668\u4e86\u3002Git \u7684\u8bbe\u8ba1\u65b9\u5f0f\uff0c\u5c31\u662f\u8ba9\u4f60\u5728\u521b\u5efa\u6216\u8005 clone \u4e00\u4e2a\u4ed3\u5e93\u7684\u65f6\u5019\uff0c\u5c31\u5b8c\u6210\u4e86\u4e00\u534a\u670d\u52a1\u5668\u7684\u642d\u5efa\u3002\u7136\u540e\u5141\u8bb8\u7528 SSH \u8bbf\u95ee\u4ed3\u5e93\uff0c\u800c\u4e14\u4efb\u4f55\u6709\u6743\u9650\u8bbf\u95ee\u7684\u4eba\u90fd\u53ef\u4ee5\u4f7f\u7528\u4f60\u7684\u4ed3\u5e93\u4f5c\u4e3a clone \u7684\u65b0\u4ed3\u5e93\u7684\u57fa\u7840\u3002<\/p>\n

\u4f46\u662f\uff0c\u8fd9\u662f\u4e00\u4e2a\u5c0f\u7684\u70b9\u5bf9\u70b9\u73af\u5883\uff08<\/rp>\uff09<\/rp><\/ruby>\u3002\u6309\u7167\u4e00\u4e9b\u65b9\u6848\u4f60\u53ef\u4ee5\u521b\u5efa\u4e00\u4e9b\u5e26\u6709\u540c\u6837\u7684\u529f\u80fd\u7684\u8bbe\u8ba1\u4f18\u826f\u7684 Git \u670d\u52a1\u5668\uff0c\u540c\u65f6\u6709\u66f4\u597d\u7684\u62d3\u5c55\u6027\u3002<\/p>\n

\u9996\u8981\u4e4b\u4e8b\uff1a\u786e\u8ba4\u4f60\u7684\u7528\u6237\u4eec\uff0c\u73b0\u5728\u7684\u7528\u6237\u4ee5\u53ca\u4e4b\u540e\u7684\u7528\u6237\u90fd\u8981\u8003\u8651\u3002\u5982\u679c\u4f60\u662f\u552f\u4e00\u7684\u7528\u6237\u90a3\u4e48\u6ca1\u6709\u4efb\u4f55\u6539\u52a8\u7684\u5fc5\u8981\u3002\u4f46\u662f\u5982\u679c\u4f60\u8bd5\u56fe\u9080\u8bf7\u5176\u4ed6\u7684\u4ee3\u7801\u8d21\u732e\u8005\u4f7f\u7528\uff0c\u90a3\u4e48\u4f60\u5e94\u8be5\u5141\u8bb8\u4e00\u4e2a\u4e13\u95e8\u7684\u5206\u4eab\u7cfb\u7edf\u7528\u6237\u7ed9\u4f60\u7684\u5f00\u53d1\u8005\u4eec\u3002<\/p>\n

\u5047\u5b9a\u4f60\u6709\u4e00\u4e2a\u53ef\u7528\u7684\u670d\u52a1\u5668\uff08\u5982\u679c\u6ca1\u6709\uff0c\u8fd9\u4e0d\u6210\u95ee\u9898\uff0cGit \u4f1a\u5e2e\u5fd9\u89e3\u51b3\uff0cCentOS \u7684 \u6811\u8393\u6d3e 3 \u662f\u4e2a\u4e0d\u9519\u7684\u5f00\u59cb\uff09\uff0c\u7136\u540e\u7b2c\u4e00\u6b65\u5c31\u662f\u53ea\u5141\u8bb8\u4f7f\u7528 SSH \u5bc6\u94a5\u8ba4\u8bc1\u7684 SSH \u767b\u5f55\u3002\u8fd9\u6bd4\u4f7f\u7528\u5bc6\u7801\u767b\u5f55\u5b89\u5168\u5f97\u591a\uff0c\u56e0\u4e3a\u8fd9\u53ef\u4ee5\u514d\u4e8e\u66b4\u529b\u7834\u89e3\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u76f4\u63a5\u5220\u9664\u7528\u6237\u5bc6\u94a5\u800c\u7981\u7528\u7528\u6237\u3002<\/p>\n

\u4e00\u65e6\u4f60\u542f\u7528\u4e86 SSH \u5bc6\u94a5\u8ba4\u8bc1\uff0c\u521b\u5efa gituser<\/span> \u7528\u6237\u3002\u8fd9\u662f\u7ed9\u4f60\u7684\u6240\u6709\u6388\u6743\u7684\u7528\u6237\u4eec\u7684\u516c\u5171\u7528\u6237\uff1a<\/p>\n

$ su -c 'adduser gituser'<\/pre>\n

\u7136\u540e\u5207\u6362\u5230\u521a\u521b\u5efa\u7684 gituser<\/span> \u7528\u6237\uff0c\u521b\u5efa\u4e00\u4e2a ~\/.ssh<\/span> \u7684\u6846\u67b6\uff0c\u5e76\u8bbe\u7f6e\u597d\u5408\u9002\u7684\u6743\u9650\u3002\u8fd9\u5f88\u91cd\u8981\uff0c\u5982\u679c\u6743\u9650\u8bbe\u7f6e\u5f97\u592a\u5f00\u653e\u4f1a\u4f7f\u81ea\u5df1\u6240\u4fdd\u62a4\u7684 SSH \u6ca1\u6709\u610f\u4e49\u3002<\/p>\n

$ su - gituser\r\n$ mkdir .ssh && chmod 700 .ssh\r\n$ touch .ssh\/authorized_keys\r\n$ chmod 600 .ssh\/authorized_keys<\/pre>\n

authorized_keys<\/span> \u6587\u4ef6\u91cc\u5305\u542b\u6240\u6709\u4f60\u7684\u5f00\u53d1\u8005\u4eec\u7684 SSH \u516c\u94a5\uff0c\u4f60\u5f00\u653e\u6743\u9650\u5141\u8bb8\u4ed6\u4eec\u53ef\u4ee5\u5728\u4f60\u7684 Git \u9879\u76ee\u4e0a\u5de5\u4f5c\u3002\u4ed6\u4eec\u5fc5\u987b\u521b\u5efa\u4ed6\u4eec\u81ea\u5df1\u7684 SSH \u5bc6\u94a5\u5bf9\u7136\u540e\u628a\u4ed6\u4eec\u7684\u516c\u94a5\u7ed9\u4f60\u3002\u590d\u5236\u516c\u94a5\u5230 gituser \u7528\u6237\u4e0b\u7684 authorized_keys<\/span> \u6587\u4ef6\u4e2d\u3002\u4f8b\u5982\uff0c\u4e3a\u4e00\u4e2a\u53eb Bob \u7684\u5f00\u53d1\u8005\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

$ cat ~\/path\/to\/id_rsa.bob.pub >> \/home\/gituser\/.ssh\/authorized_keys<\/pre>\n

\u53ea\u8981\u5f00\u53d1\u8005 Bob \u6709\u79c1\u94a5\u5e76\u4e14\u628a\u76f8\u5bf9\u5e94\u7684\u516c\u94a5\u7ed9\u4f60\uff0cBob \u5c31\u53ef\u4ee5\u7528 gituser<\/span> \u7528\u6237\u8bbf\u95ee\u670d\u52a1\u5668\u3002
\n<\/p>\n

\u4f46\u662f\uff0c\u4f60\u5e76\u4e0d\u662f\u60f3\u8ba9\u4f60\u7684\u5f00\u53d1\u8005\u4eec\u80fd\u4f7f\u7528\u670d\u52a1\u5668\uff0c\u5373\u4f7f\u53ea\u662f\u4ee5 gituser<\/span> \u7684\u8eab\u4efd\u8bbf\u95ee\u3002\u4f60\u53ea\u662f\u60f3\u7ed9\u4ed6\u4eec\u8bbf\u95ee Git \u4ed3\u5e93\u7684\u6743\u9650\u3002\u56e0\u4e3a\u8fd9\u4e2a\u7279\u6b8a\u7684\u539f\u56e0\uff0cGit \u63d0\u4f9b\u4e86\u4e00\u4e2a\u9650\u5236\u7684 shell\uff0c\u51c6\u786e\u7684\u8bf4\u662fgit-shell<\/span> \u3002\u4ee5 root \u8eab\u4efd\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff0c\u628a git-shell<\/span>\u6dfb\u52a0\u5230\u4f60\u7684\u7cfb\u7edf\u4e2d\uff0c\u7136\u540e\u8bbe\u7f6e\u6210gituser<\/span> \u7528\u6237\u7684\u9ed8\u8ba4 shell\u3002<\/p>\n

# grep git-shell \/etc\/shells || su -c \"echo `which git-shell` >> \/etc\/shells\"\r\n# su -c 'usermod -s git-shell gituser'<\/pre>\n

\u73b0\u5728 gituser<\/span> \u7528\u6237\u53ea\u80fd\u4f7f\u7528 SSH \u6765 push \u6216\u8005 pull Git \u4ed3\u5e93\uff0c\u5e76\u4e14\u65e0\u6cd5\u4f7f\u7528\u4efb\u4f55\u4e00\u4e2a\u53ef\u4ee5\u767b\u5f55\u7684 shell\u3002\u4f60\u5e94\u8be5\u628a\u4f60\u81ea\u5df1\u6dfb\u52a0\u5230\u548c gituser<\/span> \u4e00\u6837\u7684\u7ec4\u4e2d\uff0c\u5728\u6211\u4eec\u7684\u6837\u4f8b\u670d\u52a1\u5668\u4e2d\u8fd9\u4e2a\u7ec4\u7684\u540d\u5b57\u4e5f\u662f gituser<\/span>\u3002<\/p>\n

\u4e3e\u4e2a\u4f8b\u5b50\uff1a<\/p>\n

# usermod -a -G gituser seth<\/pre>\n

\u4ec5\u5269\u4e0b\u7684\u4e00\u6b65\u5c31\u662f\u521b\u5efa\u4e00\u4e2a Git \u4ed3\u5e93\u3002\u56e0\u4e3a\u6ca1\u6709\u4eba\u80fd\u5728\u670d\u52a1\u5668\u4e0a\u76f4\u63a5\u4e0e Git \u4ea4\u4e92\uff08\u4e5f\u5c31\u662f\u8bf4\uff0c\u4f60\u4e4b\u540e\u4e0d\u80fd SSH \u5230\u670d\u52a1\u5668\u7136\u540e\u76f4\u63a5\u64cd\u4f5c\u8fd9\u4e2a\u4ed3\u5e93\uff09\uff0c\u6240\u4ee5\u521b\u5efa\u4e00\u4e2a\u7a7a\u7684\u4ed3\u5e93 \u3002\u5982\u679c\u4f60\u60f3\u4f7f\u7528\u8fd9\u4e2a\u653e\u5728\u670d\u52a1\u5668\u4e0a\u7684\u4ed3\u5e93\u6765\u5b8c\u6210\u5de5\u4f5c\uff0c\u4f60\u53ef\u4ee5\u4ece\u5b83\u7684\u6240\u5728\u5904clone<\/span> \u4e0b\u6765\uff0c\u7136\u540e\u5728\u4f60\u7684 home \u76ee\u5f55\u4e0b\u8fdb\u884c\u5de5\u4f5c\u3002<\/p>\n

\u4e25\u683c\u5730\u8bb2\uff0c\u4f60\u4e0d\u662f\u5fc5\u987b\u521b\u5efa\u8fd9\u4e2a\u7a7a\u7684\u4ed3\u5e93\uff1b\u5b83\u548c\u4e00\u4e2a\u6b63\u5e38\u7684\u4ed3\u5e93\u4e00\u6837\u5de5\u4f5c\u3002\u4f46\u662f\uff0c\u4e00\u4e2a\u7a7a\u7684\u4ed3\u5e93\u6ca1\u6709\u5de5\u4f5c\u5206\u652f\uff08working tree\uff09 \uff08\u4e5f\u5c31\u662f\u8bf4\uff0c\u4f7f\u7528 checkout<\/span>\u5e76\u6ca1\u6709\u4efb\u4f55\u5206\u652f\u663e\u793a\uff09\u3002\u8fd9\u5f88\u91cd\u8981\uff0c\u56e0\u4e3a\u4e0d\u5141\u8bb8\u8fdc\u7a0b\u4f7f\u7528\u8005\u4eecpush<\/span> \u5230\u4e00\u4e2a\u6709\u6548\u7684\u5206\u652f\u4e0a\uff08\u5982\u679c\u4f60\u6b63\u5728 dev<\/span> \u5206\u652f\u5de5\u4f5c\u7136\u540e\u7a81\u7136\u6709\u4eba\u628a\u4e00\u4e9b\u53d8\u66f4push<\/span> \u5230\u4f60\u7684\u5de5\u4f5c\u5206\u652f\uff0c\u4f60\u4f1a\u6709\u600e\u4e48\u6837\u7684\u611f\u53d7\uff1f\uff09\u3002\u56e0\u4e3a\u4e00\u4e2a\u7a7a\u7684\u4ed3\u5e93\u53ef\u4ee5\u6ca1\u6709\u6709\u6548\u7684\u5206\u652f\uff0c\u6240\u4ee5\u8fd9\u4e0d\u4f1a\u6210\u4e3a\u4e00\u4e2a\u95ee\u9898\u3002<\/p>\n

\u4f60\u53ef\u4ee5\u628a\u8fd9\u4e2a\u4ed3\u5e93\u653e\u5230\u4efb\u4f55\u4f60\u60f3\u653e\u7684\u5730\u65b9\uff0c\u53ea\u8981\u4f60\u60f3\u8981\u653e\u5f00\u6743\u9650\u7ed9\u7528\u6237\u548c\u7528\u6237\u7ec4\uff0c\u8ba9\u4ed6\u4eec\u53ef\u4ee5\u5728\u4ed3\u5e93\u4e0b\u5de5\u4f5c\u3002\u5343\u4e07\u4e0d\u8981\u4fdd\u5b58\u76ee\u5f55\u5230\u6bd4\u5982\u8bf4\u4e00\u4e2a\u7528\u6237\u7684 home \u76ee\u5f55\u4e0b\uff0c\u56e0\u4e3a\u90a3\u91cc\u6709\u4e25\u683c\u7684\u6743\u9650\u9650\u5236\u3002\u4fdd\u5b58\u5230\u4e00\u4e2a\u5e38\u89c4\u7684\u5171\u4eab\u5730\u5740\uff0c\u4f8b\u5982\/opt<\/span> \u6216\u8005 \/usr\/local\/share<\/span>\u3002<\/p>\n

\u4ee5 root \u8eab\u4efd\u521b\u5efa\u4e00\u4e2a\u7a7a\u7684\u4ed3\u5e93\uff1a<\/p>\n

# git init --bare \/opt\/jupiter.git\r\n# chown -R gituser:gituser \/opt\/jupiter.git\r\n# chmod -R 770 \/opt\/jupiter.git<\/pre>\n

\u73b0\u5728\u4efb\u4f55\u4e00\u4e2a\u7528\u6237\uff0c\u53ea\u8981\u4ed6\u88ab\u8ba4\u8bc1\u4e3agituser<\/span> \u6216\u8005\u5728gituser<\/span> \u7ec4\u4e2d\uff0c\u5c31\u53ef\u4ee5\u4ece jupiter.git \u5e93\u4e2d\u8bfb\u53d6\u6216\u8005\u5199\u5165\u3002\u5728\u672c\u5730\u673a\u5668\u5c1d\u8bd5\u4ee5\u4e0b\u64cd\u4f5c\uff1a<\/p>\n

$ git clone gituser@example.com:\/opt\/jupiter.git jupiter.clone\r\nCloning into 'jupiter.clone'...\r\nWarning: you appear to have cloned an empty repository.<\/pre>\n

\u8c28\u8bb0\uff1a\u5f00\u53d1\u8005\u4eec\u4e00\u5b9a<\/strong>\u8981\u628a\u4ed6\u4eec\u7684 SSH \u516c\u94a5\u52a0\u5165\u5230gituser<\/span> \u7528\u6237\u4e0b\u7684 authorized_keys<\/span>\u6587\u4ef6\u91cc\uff0c\u6216\u8005\u8bf4\uff0c\u5982\u679c\u4ed6\u4eec\u6709\u670d\u52a1\u5668\u4e0a\u7684\u7528\u6237\uff08\u5982\u679c\u4f60\u7ed9\u4e86\u4ed6\u4eec\u7528\u6237\uff09\uff0c\u90a3\u4e48\u4ed6\u4eec\u7684\u7528\u6237\u5fc5\u987b\u5c5e\u4e8e gituser<\/span> \u7528\u6237\u7ec4\u3002<\/p>\n

Git \u94a9\u5b50<\/strong><\/div>\n

\u8fd0\u884c\u4f60\u81ea\u5df1\u7684 Git \u670d\u52a1\u5668\u6700\u8d5e\u7684\u4e00\u4ef6\u4e8b\u4e4b\u4e00\u5c31\u662f\u53ef\u4ee5\u4f7f\u7528 Git \u94a9\u5b50\u3002Git \u6258\u7ba1\u670d\u52a1\u6709\u65f6\u63d0\u4f9b\u4e00\u4e2a\u94a9\u5b50\u7c7b\u7684\u63a5\u53e3\uff0c\u4f46\u662f\u4ed6\u4eec\u5e76\u4e0d\u4f1a\u7ed9\u4f60\u771f\u6b63\u7684 Git \u94a9\u5b50\u6765\u8ba9\u4f60\u8bbf\u95ee\u6587\u4ef6\u7cfb\u7edf\u3002Git \u94a9\u5b50\u662f\u4e00\u4e2a\u811a\u672c\uff0c\u5b83\u5c06\u5728\u4e00\u4e2a Git \u8fc7\u7a0b\u7684\u67d0\u4e9b\u70b9\u8fd0\u884c\uff1b\u94a9\u5b50\u53ef\u4ee5\u8fd0\u884c\u5728\u5f53\u4e00\u4e2a\u4ed3\u5e93\u5373\u5c06\u63a5\u6536\u4e00\u4e2acommit<\/span> \u65f6\u3001\u6216\u8005\u63a5\u53d7\u4e00\u4e2a commit<\/span>\u4e4b\u540e\uff0c\u6216\u8005\u5373\u5c06\u63a5\u6536\u4e00\u6b21 push<\/span> \u65f6\uff0c\u6216\u8005\u4e00\u6b21 push<\/span>\u4e4b\u540e\u7b49\u7b49\u3002<\/p>\n

\u8fd9\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u7cfb\u7edf\uff1a\u4efb\u4f55\u653e\u5728.git\/hooks<\/span> \u76ee\u5f55\u4e0b\u7684\u811a\u672c\u3001\u4f7f\u7528\u6807\u51c6\u7684\u547d\u540d\u4f53\u7cfb\uff0c\u5c31\u53ef\u6309\u8bbe\u8ba1\u597d\u7684\u65f6\u95f4\u8fd0\u884c\u3002\u4e00\u4e2a\u811a\u672c\u662f\u5426\u5e94\u8be5\u88ab\u8fd0\u884c\u53d6\u51b3\u4e8e\u5b83\u7684\u540d\u5b57\uff1bpre-push<\/span> \u811a\u672c\u5728push<\/span> \u4e4b\u524d\u8fd0\u884c\uff0cpost-receive<\/span> \u811a\u672c\u5728\u63a5\u53d7 commit<\/span> \u4e4b\u540e\u8fd0\u884c\u7b49\u7b49\u3002\u8fd9\u6216\u591a\u6216\u5c11\u7684\u53ef\u4ee5\u4ece\u540d\u5b57\u4e0a\u770b\u51fa\u6765\u3002<\/p>\n

\u811a\u672c\u53ef\u4ee5\u7528\u4efb\u4f55\u8bed\u8a00\u5199\uff1b\u5982\u679c\u5728\u4f60\u7684\u7cfb\u7edf\u4e0a\u6709\u53ef\u4ee5\u6267\u884c\u7684\u811a\u672c\u8bed\u8a00\uff0c\u4f8b\u5982\u8f93\u51fa \u2018hello world\u2019 \uff0c\u90a3\u4e48\u4f60\u5c31\u53ef\u4ee5\u8fd9\u4e2a\u8bed\u8a00\u6765\u5199 Git \u94a9\u5b50\u811a\u672c\u3002Git \u9ed8\u8ba4\u5e26\u4e86\u4e00\u4e9b\u4f8b\u5b50\uff0c\u4f46\u662f\u5e76\u4e0d\u6709\u542f\u7528\u3002<\/p>\n

\u60f3\u8981\u52a8\u624b\u8bd5\u4e00\u4e2a\uff1f\u8fd9\u5f88\u7b80\u5355\u3002\u5982\u679c\u4f60\u6ca1\u6709\u73b0\u6210\u7684 Git \u4ed3\u5e93\uff0c\u9996\u5148\u521b\u5efa\u4e00\u4e2a Git \u4ed3\u5e93\uff1a<\/p>\n

$ mkdir jupiter\r\n$ cd jupiter\r\n$ git init .<\/pre>\n

\u7136\u540e\u5199\u4e00\u4e2a \u201chello world\u201d \u7684 Git \u94a9\u5b50\u3002\u56e0\u4e3a\u6211\u4e3a\u4e86\u652f\u6301\u8001\u65e7\u7cfb\u7edf\u800c\u4f7f\u7528 tsch\uff0c\u6240\u4ee5\u6211\u4ecd\u7136\u7528\u5b83\u4f5c\u4e3a\u6211\u7684\u811a\u672c\u8bed\u8a00\uff0c\u4f60\u53ef\u4ee5\u81ea\u7531\u7684\u4f7f\u7528\u81ea\u5df1\u559c\u6b22\u7684\u8bed\u8a00\uff08Bash\uff0cPython\uff0cRuby\uff0cPerl\uff0cRust\uff0cSwift\uff0cGo\uff09\uff1a<\/p>\n

$ echo \"#\/!\/bin\/tcsh\" > .git\/hooks\/post-commit\r\n$ echo \"echo 'POST-COMMIT SCRIPT TRIGGERED'\" >> ~\/jupiter\/.git\/hooks\/post-commit\r\n$ chmod +x ~\/jupiter\/.git\/hooks\/post-commit<\/pre>\n

\u73b0\u5728\u6d4b\u8bd5\u5b83\u7684\u8f93\u51fa\uff1a<\/p>\n

$ echo \"hello world\" > foo.txt\r\n$ git add foo.txt\r\n$ git commit -m 'first commit'\r\n! POST-COMMIT SCRIPT TRIGGERED\r\n[master (root-commit) c8678e0] first commit\r\n1 file changed, 1 insertion(+)\r\ncreate mode 100644 foo.txt<\/pre>\n

\u73b0\u5728\u4f60\u5df2\u7ecf\u5b9e\u73b0\u4e86\uff1a\u4f60\u7684\u7b2c\u4e00\u4e2a\u6709\u529f\u80fd\u7684 Git \u94a9\u5b50\u3002<\/p>\n

\u6709\u540d\u7684 push-to-web \u94a9\u5b50<\/strong><\/div>\n

Git \u94a9\u5b50\u6700\u6d41\u884c\u7684\u7528\u6cd5\u5c31\u662f\u81ea\u52a8 push<\/span> \u66f4\u6539\u7684\u4ee3\u7801\u5230\u4e00\u4e2a\u6b63\u5728\u4f7f\u7528\u4e2d\u7684\u4ea7\u54c1\u7ea7 Web \u670d\u52a1\u5668\u76ee\u5f55\u4e0b\u3002\u8fd9\u662f\u6446\u8131 FTP \u7684\u5f88\u597d\u7684\u65b9\u5f0f\uff0c\u5bf9\u4e8e\u6b63\u5728\u4f7f\u7528\u7684\u4ea7\u54c1\u4fdd\u7559\u5b8c\u6574\u7684\u7248\u672c\u63a7\u5236\uff0c\u6574\u5408\u5e76\u81ea\u52a8\u5316\u5185\u5bb9\u7684\u53d1\u5e03\u3002<\/p>\n

<\/p>\n

\u5982\u679c\u64cd\u4f5c\u6b63\u786e\uff0c\u7f51\u7ad9\u53d1\u5e03\u5de5\u4f5c\u4f1a\u50cf\u4ee5\u524d\u4e00\u6837\u5f88\u597d\u7684\u5b8c\u6210\uff0c\u800c\u4e14\u5728\u67d0\u79cd\u7a0b\u5ea6\u4e0a\uff0c\u5f88\u7cbe\u51c6\u3002Git \u771f\u7684\u597d\u68d2\u3002\u6211\u4e0d\u77e5\u9053\u8c01\u6700\u521d\u60f3\u5230\u8fd9\u4e2a\u4e3b\u610f\uff0c\u4f46\u662f\u6211\u662f\u4ece Emacs \u548c Git \u65b9\u9762\u7684\u4e13\u5bb6\uff0cIBM \u7684 Bill von Hagen \u90a3\u91cc\u7b2c\u4e00\u6b21\u542c\u5230\u5b83\u7684\u3002\u4ed6\u7684\u6587\u7ae0\u5305\u542b\u5173\u4e8e\u8fd9\u4e2a\u8fc7\u7a0b\u7684\u6743\u5a01\u4ecb\u7ecd\uff1aGit \u6539\u53d8\u4e86\u5206\u5e03\u5f0f\u7f51\u9875\u5f00\u53d1\u7684\u6e38\u620f\u89c4\u5219\u3002<\/p>\n

Git \u53d8\u91cf<\/strong><\/div>\n

\u6bcf\u4e00\u4e2a Git \u94a9\u5b50\u90fd\u6709\u4e00\u7cfb\u5217\u4e0d\u540c\u7684\u53d8\u91cf\u5bf9\u5e94\u89e6\u53d1\u94a9\u5b50\u7684\u4e0d\u540c Git \u884c\u4e3a\u3002\u4f60\u9700\u4e0d\u9700\u8981\u8fd9\u4e9b\u53d8\u91cf\uff0c\u4e3b\u8981\u53d6\u51b3\u4e8e\u4f60\u5199\u7684\u7a0b\u5e8f\u3002\u5982\u679c\u4f60\u53ea\u662f\u9700\u8981\u4e00\u4e2a\u5f53\u67d0\u4eba push \u4ee3\u7801\u65f6\u5019\u7684\u901a\u7528\u90ae\u4ef6\u901a\u77e5\uff0c\u90a3\u4e48\u4f60\u5c31\u4e0d\u9700\u8981\u4ec0\u4e48\u7279\u6b8a\u7684\u4e1c\u897f\uff0c\u751a\u81f3\u4e5f\u4e0d\u9700\u8981\u7f16\u5199\u989d\u5916\u7684\u811a\u672c\uff0c\u56e0\u4e3a\u5df2\u7ecf\u6709\u73b0\u6210\u7684\u9002\u5408\u4f60\u7684\u6837\u4f8b\u811a\u672c\u3002\u5982\u679c\u4f60\u60f3\u5728\u90ae\u4ef6\u91cc\u67e5\u770bcommit<\/span> \u4fe1\u606f\u548c commit<\/span>\u7684\u4f5c\u8005\uff0c\u90a3\u4e48\u4f60\u7684\u811a\u672c\u5c31\u4f1a\u53d8\u5f97\u76f8\u5bf9\u9ebb\u70e6\u4e9b\u3002<\/p>\n

Git \u94a9\u5b50\u5e76\u4e0d\u662f\u88ab\u7528\u6237\u76f4\u63a5\u6267\u884c\uff0c\u6240\u4ee5\u8981\u5f04\u6e05\u695a\u5982\u4f55\u6536\u96c6\u53ef\u80fd\u4f1a\u6df7\u6dc6\u7684\u91cd\u8981\u4fe1\u606f\u3002\u4e8b\u5b9e\u4e0a\uff0cGit \u94a9\u5b50\u811a\u672c\u7c7b\u4f3c\u4e8e\u5176\u4ed6\u7684\u811a\u672c\uff0c\u50cf BASH\u3001Python\u3001C++ \u7b49\u7b49\u4e00\u6837\u4ece\u6807\u51c6\u8f93\u5165\u8bfb\u53d6\u53c2\u6570\u3002\u4e0d\u540c\u7684\u662f\uff0c\u6211\u4eec\u4e0d\u4f1a\u7ed9\u5b83\u63d0\u4f9b\u8fd9\u4e2a\u8f93\u5165\uff0c\u6240\u4ee5\uff0c\u4f60\u5728\u4f7f\u7528\u7684\u65f6\u5019\uff0c\u9700\u8981\u77e5\u9053\u53ef\u80fd\u7684\u8f93\u5165\u53c2\u6570\u3002<\/p>\n

\u5728\u5199 Git \u94a9\u5b50\u4e4b\u524d\uff0c\u770b\u4e00\u4e0b Git \u5728\u4f60\u7684\u9879\u76ee\u76ee\u5f55\u4e0b .git\/hooks<\/span> \u76ee\u5f55\u4e2d\u63d0\u4f9b\u7684\u4e00\u4e9b\u4f8b\u5b50\u3002\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u5728\u8fd9\u4e2a pre-push.sample<\/span> \u6587\u4ef6\u91cc\uff0c\u6ce8\u91ca\u90e8\u5206\u8bf4\u660e\u4e86\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n

# $1 -- \u5373\u5c06 push \u7684\u8fdc\u7a0b\u4ed3\u5e93\u7684\u540d\u5b57\r\n# $2 -- \u5373\u5c06 push \u7684\u8fdc\u7a0b\u4ed3\u5e93\u7684 URL\r\n# \u5982\u679c push \u7684\u65f6\u5019\uff0c\u5e76\u6ca1\u6709\u4e00\u4e2a\u547d\u540d\u7684\u8fdc\u7a0b\u4ed3\u5e93\uff0c\u90a3\u4e48\u8fd9\u4e24\u4e2a\u53c2\u6570\u5c06\u4f1a\u4e00\u6837\u3002\r\n#\r\n# \u63d0\u4ea4\u7684\u4fe1\u606f\u5c06\u4ee5\u4e0b\u5217\u5f62\u5f0f\u6309\u884c\u53d1\u9001\u7ed9\u6807\u51c6\u8f93\u5165\r\n# <local ref> <local sha1> <remote ref> <remote sha1><\/pre>\n

\u5e76\u4e0d\u662f\u6240\u6709\u7684\u4f8b\u5b50\u90fd\u662f\u8fd9\u4e48\u6e05\u6670\uff0c\u800c\u4e14\u5173\u4e8e\u94a9\u5b50\u83b7\u53d6\u53d8\u91cf\u7684\u6587\u6863\u4f9d\u65e7\u7f3a\u4e4f\uff08\u9664\u975e\u4f60\u53bb\u8bfb Git \u7684\u6e90\u7801\uff09\u3002\u4f46\u662f\uff0c\u5982\u679c\u4f60\u6709\u7591\u95ee\uff0c\u4f60\u53ef\u4ee5\u4ece\u7ebf\u4e0a\u5176\u4ed6\u7528\u6237\u7684\u5c1d\u8bd5\u4e2d\u5b66\u4e60\uff0c\u6216\u8005\u4f60\u53ea\u662f\u5199\u4e00\u4e9b\u57fa\u672c\u7684\u811a\u672c\uff0c\u6bd4\u5982 echo $1, $2, $3<\/span> \u7b49\u7b49\u3002<\/p>\n

\u5206\u652f\u68c0\u6d4b\u793a\u4f8b<\/strong><\/div>\n

\u6211\u53d1\u73b0\uff0c\u5bf9\u4e8e\u751f\u4ea7\u73af\u5883\u6765\u8bf4\u6709\u4e00\u4e2a\u5171\u540c\u7684\u9700\u6c42\uff0c\u5c31\u662f\u9700\u8981\u4e00\u4e2a\u53ea\u6709\u5728\u7279\u5b9a\u5206\u652f\u88ab\u4fee\u6539\u4e4b\u540e\uff0c\u624d\u4f1a\u89e6\u53d1\u4e8b\u4ef6\u7684\u94a9\u5b50\u3002\u4ee5\u4e0b\u5c31\u662f\u5982\u4f55\u8ddf\u8e2a\u5206\u652f\u7684\u793a\u4f8b\u3002<\/p>\n

\u9996\u5148\uff0cGit \u94a9\u5b50\u672c\u8eab\u662f\u4e0d\u53d7\u7248\u672c\u63a7\u5236\u7684\u3002 Git \u5e76\u4e0d\u4f1a\u8ddf\u8e2a\u5b83\u81ea\u5df1\u7684\u94a9\u5b50\uff0c\u56e0\u4e3a\u5bf9\u4e8e\u94a9\u5b50\u6765\u8bf4\uff0c\u5b83\u662f Git \u7684\u4e00\u90e8\u5206\uff0c\u800c\u4e0d\u662f\u4f60\u4ed3\u5e93\u7684\u4e00\u90e8\u5206\u3002\u6240\u4ee5\uff0cGit \u94a9\u5b50\u53ef\u4ee5\u76d1\u63a7\u4f60\u7684 Git \u670d\u52a1\u5668\u4e0a\u7684\u4e00\u4e2a\u7a7a\u4ed3\u5e93\u7684 commit<\/span> \u8bb0\u5f55\u548c push<\/span> \u8bb0\u5f55\uff0c\u800c\u4e0d\u662f\u4f60\u672c\u5730\u4ed3\u5e93\u7684\u4e00\u90e8\u5206\u3002<\/p>\n

\u6211\u4eec\u6765\u5199\u4e00\u4e2a post-receive<\/span>\uff08\u4e5f\u5c31\u662f\u8bf4\uff0c\u5728 commit<\/span> \u88ab\u63a5\u53d7\u4e4b\u540e\u89e6\u53d1\uff09\u94a9\u5b50\u3002\u7b2c\u4e00\u6b65\u5c31\u662f\u9700\u8981\u786e\u5b9a\u5206\u652f\u540d\uff1a<\/p>\n

#!\/bin\/tcsh\r\nforeach arg ( $< )\r\nset argv = ( $arg )\r\nset refname = $1\r\nend<\/pre>\n

\u8fd9\u4e2a for \u5faa\u73af\u7528\u6765\u8bfb\u5165\u7b2c\u4e00\u4e2a\u53c2\u6570 $1<\/span> \uff0c\u7136\u540e\u5faa\u73af\u7528\u7b2c\u4e8c\u4e2a\u53c2\u6570$2<\/span> \u53bb\u8986\u76d6\u5b83\uff0c\u7136\u540e\u7528\u7b2c\u4e09\u4e2a\u53c2\u6570 $3<\/span>\u00a0\u518d\u8fd9\u6837\u3002\u5728 Bash \u4e2d\u6709\u4e00\u4e2a\u66f4\u597d\u7684\u65b9\u6cd5\uff0c\u4f7f\u7528 read<\/span>\u547d\u4ee4\uff0c\u5e76\u4e14\u628a\u503c\u653e\u5165\u6570\u7ec4\u91cc\u3002\u4f46\u662f\uff0c\u8fd9\u91cc\u662f tcsh\uff0c\u5e76\u4e14\u53d8\u91cf\u7684\u987a\u5e8f\u53ef\u4ee5\u9884\u6d4b\u7684\uff0c\u6240\u4ee5\uff0c\u8fd9\u4e2a\u65b9\u6cd5\u4e5f\u662f\u53ef\u884c\u7684\u3002<\/p>\n

\u5f53\u6211\u4eec\u6709\u4e86 commit \u8bb0\u5f55\u7684 refname<\/span>\uff0c\u6211\u4eec\u5c31\u80fd\u4f7f\u7528 Git \u53bb\u627e\u5230\u8fd9\u4e2a\u5206\u652f\u7684\u4f9b\u4eba\u770b\u7684\u540d\u5b57\uff1a<\/p>\n

set branch = `git rev-parse --symbolic --abbrev-ref $refname`\r\necho $branch #DEBUG<\/pre>\n

\u7136\u540e\u628a\u8fd9\u4e2a\u5206\u652f\u540d\u548c\u6211\u4eec\u60f3\u8981\u89e6\u53d1\u7684\u4e8b\u4ef6\u7684\u5206\u652f\u540d\u5173\u952e\u5b57\u8fdb\u884c\u6bd4\u8f83\uff1a<\/p>\n

if ( \"$branch\" == \"master\" ) then\r\necho \"Branch detected: master\"\r\ngit \/\r\n--work-tree=\/path\/to\/where\/you\/want\/to\/copy\/stuff\/to \/\r\ncheckout -f $branch || echo \"master fail\"\r\nelse if ( \"$branch\" == \"dev\" ) then\r\necho \"Branch detected: dev\"\r\nGit \/\r\n--work-tree=\/path\/to\/where\/you\/want\/to\/copy\/stuff\/to \/\r\ncheckout -f $branch || echo \"dev fail\"\r\nelse\r\necho \"Your push was successful.\"\r\necho \"Private branch detected. No action triggered.\"\r\nendif<\/pre>\n

\u7ed9\u8fd9\u4e2a\u811a\u672c\u5206\u914d\u53ef\u6267\u884c\u6743\u9650\uff1a<\/p>\n

$ chmod +x ~\/jupiter\/.git\/hooks\/post-receive<\/pre>\n

\u73b0\u5728\uff0c\u5f53\u4e00\u4e2a\u7528\u6237\u63d0\u4ea4\u5230\u670d\u52a1\u5668\u7684 master \u5206\u652f\uff0c\u90a3\u4e9b\u4ee3\u7801\u5c31\u4f1a\u88ab\u590d\u5236\u5230\u4e00\u4e2a\u751f\u4ea7\u73af\u5883\u7684\u76ee\u5f55\uff0c\u63d0\u4ea4\u5230 dev \u5206\u652f\u5219\u4f1a\u88ab\u590d\u5236\u5230\u53e6\u5916\u7684\u5730\u65b9\uff0c\u5176\u4ed6\u5206\u652f\u5c06\u4e0d\u4f1a\u89e6\u53d1\u8fd9\u4e9b\u64cd\u4f5c\u3002<\/p>\n

\u540c\u65f6\uff0c\u521b\u9020\u4e00\u4e2apre-commit<\/span> \u811a\u672c\u4e5f\u5f88\u7b80\u5355\u3002\u6bd4\u5982\uff0c\u5224\u65ad\u4e00\u4e2a\u7528\u6237\u662f\u5426\u5728\u4ed6\u4eec\u4e0d\u8be5push<\/span> \u7684\u5206\u652f\u4e0apush<\/span> \u4ee3\u7801\uff0c\u6216\u8005\u5bf9 commit \u4fe1\u606f\u8fdb\u884c\u89e3\u6790\u7b49\u7b49\u3002<\/p>\n

Git \u94a9\u5b50\u4e5f\u53ef\u4ee5\u53d8\u5f97\u590d\u6742\uff0c\u800c\u4e14\u5b83\u4eec\u56e0\u4e3a Git \u7684\u5de5\u4f5c\u6d41\u7684\u62bd\u8c61\u5c42\u6b21\u4e0d\u540c\u800c\u53d8\u5f97\u96be\u4ee5\u7406\u89e3\uff0c\u4f46\u662f\u5b83\u4eec\u786e\u5b9e\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u7cfb\u7edf\uff0c\u8ba9\u4f60\u80fd\u591f\u5728\u4f60\u7684 Git \u57fa\u7840\u8bbe\u65bd\u4e0a\u9488\u5bf9\u6240\u6709\u7684\u884c\u4e3a\u8fdb\u884c\u5bf9\u5e94\u7684\u64cd\u4f5c\u3002\u5982\u679c\u4f60\u662f\u4e00\u4e2a Git \u91cd\u5ea6\u7528\u6237\uff0c\u6216\u8005\u4e00\u4e2a\u5168\u804c Git \u7ba1\u7406\u5458\uff0c\u90a3\u4e48 Git \u94a9\u5b50\u662f\u503c\u5f97\u5b66\u4e60\u7684\uff0c\u53ea\u6709\u5f53\u4f60\u719f\u6089\u8fd9\u4e2a\u8fc7\u7a0b\uff0c\u4f60\u624d\u80fd\u771f\u6b63\u638c\u63e1\u5b83\u3002<\/p>\n

\u5728\u6211\u4eec\u8fd9\u4e2a\u7cfb\u5217\u4e0b\u4e00\u7bc7\u4e5f\u662f\u6700\u540e\u4e00\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u4f1a\u5b66\u4e60\u5982\u4f55\u4f7f\u7528 Git \u6765\u7ba1\u7406\u975e\u6587\u672c\u7684\u4e8c\u8fdb\u5236\u6570\u636e\uff0c\u6bd4\u5982\u97f3\u9891\u548c\u56fe\u7247\u3002<\/p>\n


\n

via: https:\/\/opensource.com\/life\/16\/8\/how-construct-your-own-git-server-part-6<\/a><\/p>\n

\u4f5c\u8005\uff1aSeth Kenlon<\/a> \u8bd1\u8005\uff1amaywanting<\/a> \u6821\u5bf9\uff1awxy<\/a><\/p>\n

\u672c\u6587\u7531 LCTT<\/a> \u539f\u521b\u7f16\u8bd1\uff0cLinux\u4e2d\u56fd<\/a> \u8363\u8a89\u63a8\u51fa<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/linux.cn\/article-7800-1.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1a http:\/\/lrxjmw.cn\/build-git-server.html<\/a>\u7f16\u8f91\u5458\uff1a\u90dd\u5927\u53d1\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u73b0\u5728\u6211\u4eec\u5c06\u8981\u5b66\u4e60\u5982\u4f55\u642d\u5efa git \u670d\u52a1\u5668\uff0c\u5982\u4f55\u7f16\u5199\u81ea\u5b9a\u4e49\u7684 Git \u94a9\u5b50\u6765\u5728\u7279\u5b9a\u7684\u4e8b\u4ef6\u89e6\u53d1\u76f8\u5e94\u7684\u52a8\u4f5c\uff08\u4f8b\u5982\u901a\u77e5\uff09\uff0c\u6216\u8005\u662f\u53d1\u5e03\u4f60\u7684\u4ee3\u7801\u5230\u4e00\u4e2a\u7ad9\u70b9\u3002<\/p>\n","protected":false},"author":63,"featured_media":48728,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-32736","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/32736","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=32736"}],"version-history":[{"count":12,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/32736\/revisions"}],"predecessor-version":[{"id":272018,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/32736\/revisions\/272018"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/48728"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=32736"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=32736"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=32736"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}