{"id":19554,"date":"2024-11-19T14:35:34","date_gmt":"2024-11-19T06:35:34","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19554\/"},"modified":"2024-11-19T14:35:34","modified_gmt":"2024-11-19T06:35:34","slug":"%e5%a6%82%e4%bd%95%e5%b0%86gitlab%e4%b8%8a%e7%9a%84%e4%bb%a3%e7%a0%81%e6%8b%89%e5%8f%96%e5%88%b0%e6%9c%ac%e5%9c%b0","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19554\/","title":{"rendered":"\u5982\u4f55\u5c06GitLab\u4e0a\u7684\u4ee3\u7801\u62c9\u53d6\u5230\u672c\u5730"},"content":{"rendered":"<p>gitlab\u662f\u4e00\u4e2a\u9762\u5411\u56e2\u961f\u7684git\u4ed3\u5e93\u7ba1\u7406\u5de5\u5177\uff0c\u5b83\u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u4e00\u79cd\u7b80\u5355\u9ad8\u6548\u7684\u65b9\u5f0f\u6765\u534f\u4f5c\u5f00\u53d1\u4ee3\u7801\u3002\u65e0\u8bba\u662f\u4e2a\u4eba\u8fd8\u662f\u56e2\u961f\u5f00\u53d1\uff0cgitlab\u90fd\u80fd\u591f\u6ee1\u8db3\u5404\u79cd\u9700\u6c42\u3002\u5728gitlab\u4e0a\u5f00\u53d1\u4ee3\u7801\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u9700\u8981\u5c06\u4ee3\u7801\u62c9\u53d6\u5230\u672c\u5730\u8fdb\u884c\u6d4b\u8bd5\uff0c\u7136\u540e\u518d\u8fdb\u884c\u63d0\u4ea4\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u5c06gitlab\u4e0a\u7684\u4ee3\u7801\u62c9\u53d6\u5230\u672c\u5730\u3002<\/p>\n<p>\u7b2c\u4e00\u6b65\uff1a\u521b\u5efa\u4e00\u4e2aGitLab\u8d26\u6237<\/p>\n<p>\u9996\u5148\uff0c\u4f60\u9700\u8981\u5728GitLab\u4e0a\u6ce8\u518c\u4e00\u4e2a\u8d26\u6237\u3002\u6253\u5f00 GitLab\u5b98\u7f51\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201c\u6ce8\u518c\u201d\uff0c\u586b\u5199\u7528\u6237\u540d\u3001\u90ae\u7bb1\u3001\u5bc6\u7801\u7b49\u4fe1\u606f\uff0c\u7136\u540e\u70b9\u51fb\u201c\u6ce8\u518c\u201d\u3002<\/p>\n<p>\u540c\u610f GitLab\u7684\u6761\u6b3e\u548c\u6761\u4ef6\uff0c\u7136\u540e\u70b9\u51fb\u201c\u521b\u5efa\u8d26\u6237\u201d\u5373\u53ef\u3002<\/p>\n<p>\u7b2c\u4e8c\u6b65\uff1a\u521b\u5efa\u4e00\u4e2aGitLab\u9879\u76ee<\/p>\n<p>\u5728\u4f60\u7684 GitLab\u8d26\u6237\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9879\u76ee\u3002\u70b9\u51fb\u8fdb\u5165\u4f60\u7684\u4e2a\u4eba\u4e3b\u9875\u6216\u56e2\u961f\u4e3b\u9875\uff0c\u7136\u540e\u70b9\u51fb\u201c\u65b0\u5efa\u9879\u76ee\u201d\u3002<\/p>\n<p>\u586b\u5199\u9879\u76ee\u540d\u79f0\u548c\u63cf\u8ff0\u4fe1\u606f\u3002\u5982\u679c\u4f60\u60f3\u628a\u9879\u76ee\u5f52\u7c7b\u5230\u67d0\u4e2a\u7ec4\u4e2d\uff0c\u53ef\u4ee5\u9009\u62e9\u5df2\u6709\u7ec4\u6216\u521b\u5efa\u4e00\u4e2a\u65b0\u7ec4\u3002\u5176\u4ed6\u8bbe\u7f6e\u9009\u62e9\u9ed8\u8ba4\u503c\u5373\u53ef\u3002<\/p>\n<p>\u70b9\u51fb\u201c\u521b\u5efa\u9879\u76ee\u201d\uff0c\u4f60\u5c06\u8fdb\u5165\u8be5\u9879\u76ee\u7684\u9875\u9762\u3002<\/p>\n<p>\u7b2c\u4e09\u6b65\uff1a\u83b7\u53d6\u9879\u76ee\u7684SSH URL<\/p>\n<p>\u5728\u4f60\u7684 GitLab \u9879\u76ee\u9875\u9762\u4e2d\uff0c\u4f60\u53ef\u4ee5\u770b\u5230 GitLab \u63d0\u4f9b\u4e86\u4e09\u4e2aURL\uff0c\u5206\u522b\u662fHTTPS\u3001SSH\u3001Git\u3002<\/p>\n<p>\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u4f7f\u7528SSH URL\u6765\u514b\u9686 GitLab \u4ed3\u5e93\u3002\u590d\u5236 SSH URL\uff0c\u4f8b\u5982 git@192.168.1.1:hello-world.git\u3002<\/p>\n<p>\u7b2c\u56db\u6b65\uff1a\u5b89\u88c5Git<\/p>\n<p>\u5982\u679c\u4f60\u5df2\u7ecf\u5b89\u88c5\u4e86Git\uff0c\u53ef\u4ee5\u8df3\u8fc7\u6b64\u6b65\u9aa4\u3002\u5426\u5219\uff0c\u4f60\u9700\u8981\u5b89\u88c5Git\u624d\u80fd\u7ee7\u7eed\u8fdb\u884c\u4e0b\u9762\u7684\u6b65\u9aa4\u3002<\/p>\n<p>Git\u652f\u6301\u591a\u4e2a\u5e73\u53f0\uff0c\u4f60\u53ef\u4ee5\u5728\u5b98\u7f51\u4e0a\u4e0b\u8f7dGit\uff0c\u5e76\u6309\u7167\u5f15\u5bfc\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<p>\u7b2c\u4e94\u6b65\uff1a\u5728\u672c\u5730\u521b\u5efa\u9879\u76ee\u5b58\u50a8\u76ee\u5f55<\/p>\n<p>\u5728\u672c\u5730\u7684\u5de5\u4f5c\u76ee\u5f55\u4e2d\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u76ee\u5f55\u6765\u5b58\u50a8\u4f60\u4ece GitLab \u4ed3\u5e93\u4e2d\u514b\u9686\u7684\u4ee3\u7801\u3002\u5728\u547d\u4ee4\u884c\u4e2d\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>mkdir hello-world\ncd hello-world<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u5c06\u521b\u5efa\u4e00\u4e2a\u540d\u4e3ahello-world\u7684\u76ee\u5f55\uff0c\u5e76\u8fdb\u5165\u8be5\u76ee\u5f55\u3002<\/p>\n<p>\u7b2c\u516d\u6b65\uff1a\u901a\u8fc7Git Bash\u514b\u9686GitLab\u4e2d\u7684\u4ee3\u7801<\/p>\n<p>\u5728\u547d\u4ee4\u884c\u4e0a\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u514b\u9686\u8fdc\u7a0bGitLab\u4ee3\u7801\uff1a<\/p>\n<pre>git clone git@192.168.1.1:hello-world.git<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8bf7\u5c06git@192.168.1.1:hello-world.git\u66ff\u6362\u4e3a\u4f60\u7684GitLab\u9879\u76ee\u7684 SSH URL\u3002<\/p>\n<p>\u5982\u679c\u60a8\u6b63\u5728\u7b2c\u4e00\u6b21\u4f7f\u7528Git\uff0c\u8bf7\u7b49\u5f85\u4e00\u4e9b\u65f6\u95f4\uff0cGit\u4f1a\u81ea\u52a8\u4e0b\u8f7d\u4f60\u7684\u4ee3\u7801\u3002\u5c06 hello-world \u66ff\u6362\u4e3a\u4f60\u7684\u9879\u76ee\u540d\u79f0\u3002<\/p>\n<p>\u7b2c\u4e03\u6b65\uff1a\u62c9\u53d6\u6700\u65b0\u7684\u4ee3\u7801<\/p>\n<p>\u5728\u672c\u5730\u4ee3\u7801\u5e93\u4e2d\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u62c9\u53d6\u6700\u65b0\u7684\u4ee3\u7801\uff1a<\/p>\n<pre>git pull origin master<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u4eceGitLab\u62c9\u53d6\u6700\u65b0\u7684\u4ee3\u7801\u5e76\u5408\u5e76\u5230\u672c\u5730\u5206\u652f\u4e0a\u3002\u5982\u679c\u4f60\u60f3\u4e13\u95e8\u62c9\u53d6\u67d0\u4e2a\u5206\u652f\u7684\u4ee3\u7801\uff0c\u53ef\u4ee5\u4f7f\u7528 git pull origin branch_name \u6765\u66ff\u6362\u8fd9\u4e2a\u547d\u4ee4\u4e2d\u7684 master\u3002<\/p>\n<p>\u81f3\u6b64\uff0c\u6211\u4eec\u5c31\u6210\u529f\u5730\u5c06GitLab\u4e0a\u7684\u4ee3\u7801\u62c9\u53d6\u5230\u4e86\u672c\u5730\uff0c\u5e76\u51c6\u5907\u597d\u8fdb\u884c\u6d4b\u8bd5\u548c\u4fee\u6539\u3002\u5982\u679c\u4f60\u5bf9Git\u7684\u64cd\u4f5c\u4ecd\u4e0d\u719f\u6089\uff0c\u5efa\u8bae\u591a\u67e5\u9605 Git \u7684\u6587\u732e\u548c\u6559\u7a0b\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u5c06GitLab\u4e0a\u7684\u4ee3\u7801\u62c9\u53d6\u5230\u672c\u5730\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>gitlab\u662f\u4e00\u4e2a\u9762\u5411\u56e2\u961f\u7684git\u4ed3\u5e93\u7ba1\u7406\u5de5\u5177\uff0c\u5b83\u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u4e00\u79cd\u7b80\u5355\u9ad8\u6548\u7684\u65b9\u5f0f\u6765\u534f\u4f5c\u5f00\u53d1\u4ee3\u7801\u3002\u65e0\u8bba\u662f\u4e2a\u4eba\u8fd8\u662f\u56e2\u961f\u5f00\u53d1\uff0cgitlab\u90fd\u80fd\u591f\u6ee1\u8db3\u5404\u79cd\u9700\u6c42\u3002\u5728gitlab\u4e0a\u5f00\u53d1\u4ee3\u7801\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u9700\u8981\u5c06\u4ee3\u7801\u62c9\u53d6\u5230\u672c\u5730\u8fdb\u884c\u6d4b\u8bd5\uff0c\u7136\u540e\u518d\u8fdb\u884c\u63d0\u4ea4\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u5c06gitlab\u4e0a\u7684\u4ee3\u7801\u62c9\u53d6\u5230\u672c\u5730\u3002 \u7b2c\u4e00\u6b65\uff1a\u521b\u5efa\u4e00\u4e2aGitLab\u8d26\u6237 \u9996\u5148\uff0c\u4f60\u9700\u8981\u5728GitLab\u4e0a\u6ce8\u518c\u4e00\u4e2a\u8d26\u6237\u3002\u6253\u5f00 GitLab\u5b98\u7f51\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201c\u6ce8\u518c\u201d\uff0c\u586b\u5199\u7528\u6237\u540d\u3001\u90ae\u7bb1\u3001\u5bc6\u7801\u7b49\u4fe1\u606f\uff0c\u7136\u540e\u70b9\u51fb\u201c\u6ce8\u518c\u201d\u3002 \u540c\u610f GitLab\u7684\u6761\u6b3e\u548c\u6761\u4ef6\uff0c\u7136\u540e\u70b9\u51fb\u201c\u521b\u5efa\u8d26\u6237\u201d\u5373\u53ef\u3002 \u7b2c\u4e8c\u6b65\uff1a\u521b\u5efa\u4e00\u4e2aGitLab\u9879\u76ee \u5728\u4f60\u7684 GitLab\u8d26\u6237\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9879\u76ee\u3002\u70b9\u51fb\u8fdb\u5165\u4f60\u7684\u4e2a\u4eba\u4e3b\u9875\u6216\u56e2\u961f\u4e3b\u9875\uff0c\u7136\u540e\u70b9\u51fb\u201c\u65b0\u5efa\u9879\u76ee\u201d\u3002 \u586b\u5199\u9879\u76ee\u540d\u79f0\u548c\u63cf\u8ff0\u4fe1\u606f\u3002\u5982\u679c\u4f60\u60f3\u628a\u9879\u76ee\u5f52\u7c7b\u5230\u67d0\u4e2a\u7ec4\u4e2d\uff0c\u53ef\u4ee5\u9009\u62e9\u5df2\u6709\u7ec4\u6216\u521b\u5efa\u4e00\u4e2a\u65b0\u7ec4\u3002\u5176\u4ed6\u8bbe\u7f6e\u9009\u62e9\u9ed8\u8ba4\u503c\u5373\u53ef\u3002 \u70b9\u51fb\u201c\u521b\u5efa\u9879\u76ee\u201d\uff0c\u4f60\u5c06\u8fdb\u5165\u8be5\u9879\u76ee\u7684\u9875\u9762\u3002 \u7b2c\u4e09\u6b65\uff1a\u83b7\u53d6\u9879\u76ee\u7684SSH URL \u5728\u4f60\u7684 GitLab \u9879\u76ee\u9875\u9762\u4e2d\uff0c\u4f60\u53ef\u4ee5\u770b\u5230 GitLab \u63d0\u4f9b\u4e86\u4e09\u4e2aURL\uff0c\u5206\u522b\u662fHTTPS\u3001SSH\u3001Git\u3002 \u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u4f7f\u7528SSH URL\u6765\u514b\u9686 GitLab \u4ed3\u5e93\u3002\u590d\u5236 SSH URL\uff0c\u4f8b\u5982 git@192.168.1.1:hello-world.git\u3002 \u7b2c\u56db\u6b65\uff1a\u5b89\u88c5Git \u5982\u679c\u4f60\u5df2\u7ecf\u5b89\u88c5\u4e86Git\uff0c\u53ef\u4ee5\u8df3\u8fc7\u6b64\u6b65\u9aa4\u3002\u5426\u5219\uff0c\u4f60\u9700\u8981\u5b89\u88c5Git\u624d\u80fd\u7ee7\u7eed\u8fdb\u884c\u4e0b\u9762\u7684\u6b65\u9aa4\u3002 Git\u652f\u6301\u591a\u4e2a\u5e73\u53f0\uff0c\u4f60\u53ef\u4ee5\u5728\u5b98\u7f51\u4e0a\u4e0b\u8f7dGit\uff0c\u5e76\u6309\u7167\u5f15\u5bfc\u8fdb\u884c\u5b89\u88c5\u3002 \u7b2c\u4e94\u6b65\uff1a\u5728\u672c\u5730\u521b\u5efa\u9879\u76ee\u5b58\u50a8\u76ee\u5f55 \u5728\u672c\u5730\u7684\u5de5\u4f5c\u76ee\u5f55\u4e2d\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u76ee\u5f55\u6765\u5b58\u50a8\u4f60\u4ece GitLab \u4ed3\u5e93\u4e2d\u514b\u9686\u7684\u4ee3\u7801\u3002\u5728\u547d\u4ee4\u884c\u4e2d\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a mkdir hello-world cd hello-world \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u5c06\u521b\u5efa\u4e00\u4e2a\u540d\u4e3ahello-world\u7684\u76ee\u5f55\uff0c\u5e76\u8fdb\u5165\u8be5\u76ee\u5f55\u3002 \u7b2c\u516d\u6b65\uff1a\u901a\u8fc7Git Bash\u514b\u9686GitLab\u4e2d\u7684\u4ee3\u7801 \u5728\u547d\u4ee4\u884c\u4e0a\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u514b\u9686\u8fdc\u7a0bGitLab\u4ee3\u7801\uff1a git clone git@192.168.1.1:hello-world.git \u767b\u5f55\u540e\u590d\u5236 \u8bf7\u5c06git@192.168.1.1:hello-world.git\u66ff\u6362\u4e3a\u4f60\u7684GitLab\u9879\u76ee\u7684 SSH URL\u3002 \u5982\u679c\u60a8\u6b63\u5728\u7b2c\u4e00\u6b21\u4f7f\u7528Git\uff0c\u8bf7\u7b49\u5f85\u4e00\u4e9b\u65f6\u95f4\uff0cGit\u4f1a\u81ea\u52a8\u4e0b\u8f7d\u4f60\u7684\u4ee3\u7801\u3002\u5c06 hello-world \u66ff\u6362\u4e3a\u4f60\u7684\u9879\u76ee\u540d\u79f0\u3002 \u7b2c\u4e03\u6b65\uff1a\u62c9\u53d6\u6700\u65b0\u7684\u4ee3\u7801 \u5728\u672c\u5730\u4ee3\u7801\u5e93\u4e2d\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u62c9\u53d6\u6700\u65b0\u7684\u4ee3\u7801\uff1a git pull [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-19554","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19554","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=19554"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19554\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}