{"id":19732,"date":"2024-11-19T17:01:13","date_gmt":"2024-11-19T09:01:13","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19732\/"},"modified":"2024-11-19T17:01:13","modified_gmt":"2024-11-19T09:01:13","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-gitlab-%e7%9a%84%e7%ac%ac%e4%b8%80%e4%b8%aa%e9%a1%b9%e7%9b%ae","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19732\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 GitLab \u7684\u7b2c\u4e00\u4e2a\u9879\u76ee"},"content":{"rendered":"<p>\u4f5c\u4e3a\u4e00\u4e2a\u5f00\u6e90\u7684\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0cgitlab \u4e3a\u56e2\u961f\u534f\u4f5c\u63d0\u4f9b\u4e86\u5b8c\u7f8e\u7684\u89e3\u51b3\u65b9\u6848\u3002\u5b83\u4e0d\u4ec5\u53ef\u4ee5\u652f\u6301\u4ee3\u7801\u7ba1\u7406\uff0c\u8fd8\u80fd\u591f\u5728\u6574\u4e2a\u8f6f\u4ef6\u5f00\u53d1\u5468\u671f\u4e2d\u8fdb\u884c\u591a\u79cd\u534f\u4f5c\u529f\u80fd\uff0c\u5982\u95ee\u9898\u8ddf\u8e2a\u3001\u4ee3\u7801\u5ba1\u67e5\u7b49\u3002<\/p>\n<p>\u90a3\u4e48\uff0c\u8fd9\u7bc7\u6587\u7ae0\u7684\u4e3b\u8981\u76ee\u7684\u662f\u6559\u4f60\u5982\u4f55\u4f7f\u7528 GitLab \u7684\u7b2c\u4e00\u4e2a\u9879\u76ee\u3002\u4ee5\u4e0b\u662f\u5177\u4f53\u7684\u6b65\u9aa4\uff1a<\/p>\n<ol>\n<li>\u521b\u5efa\u4e00\u4e2a GitLab \u5e10\u53f7<\/li>\n<\/ol>\n<p>\u8981\u4f7f\u7528 GitLab\uff0c\u4f60\u9700\u8981\u5148\u521b\u5efa\u4e00\u4e2a\u5e10\u53f7\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u8bbf\u95ee GitLab \u5b98\u65b9\u7f51\u7ad9\u5b8c\u6210\u3002\u4e00\u65e6\u5728\u7f51\u7ad9\u4e0a\u6ce8\u518c\u4e86\u5e10\u53f7\uff0c\u4f60\u5c31\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9879\u76ee\u5e76\u5f00\u59cb\u5de5\u4f5c\u3002<\/p>\n<ol>\n<li>\u521b\u5efa\u4e00\u4e2a\u65b0\u9879\u76ee<\/li>\n<\/ol>\n<p>\u5728 GitLab \u4e2d\u521b\u5efa\u65b0\u9879\u76ee\u975e\u5e38\u7b80\u5355\u3002\u5728\u754c\u9762\u7684\u5de6\u4e0a\u65b9\uff0c\u4f60\u53ef\u4ee5\u770b\u5230\u4e00\u4e2a\u65b0\u5efa\u9879\u76ee\u7684\u6309\u94ae\u3002\u70b9\u51fb\u5b83\u540e\uff0c\u4f60\u5c06\u88ab\u5f15\u5bfc\u5230\u4e00\u4e2a\u65b0\u9879\u76ee\u521b\u5efa\u9875\u9762\u3002\u5728\u6b64\u9875\u9762\u4e2d\uff0c\u4f60\u9700\u8981\u8f93\u5165\u9879\u76ee\u540d\u79f0\u3001\u63cf\u8ff0\u548c\u8bbf\u95ee\u6743\u9650\u7b49\u4fe1\u606f\u3002<\/p>\n<ol>\n<li>\u5c06\u672c\u5730\u4ee3\u7801\u4e0a\u4f20\u5230 GitLab<\/li>\n<\/ol>\n<p>\u4e00\u65e6\u4f60\u521b\u5efa\u4e86\u4e00\u4e2a\u65b0\u7684 GitLab \u9879\u76ee\uff0c\u4f60\u53ef\u4ee5\u5c06\u672c\u5730\u4ee3\u7801\u4e0a\u4f20\u5230\u5176\u4e2d\u3002\u5728 GitLab \u9875\u9762\u4e2d\uff0c\u4f60\u53ef\u4ee5\u627e\u5230\u4e00\u4e2a Clone \u6309\u94ae\u3002\u70b9\u51fb\u5b83\u540e\uff0cGitLab \u5c06\u63d0\u793a\u4f60\u4f7f\u7528 SSH \u6216 HTTPS \u4ece\u672c\u5730\u8ba1\u7b97\u673a\u514b\u9686\u5230\u8be5\u9879\u76ee\u3002<\/p>\n<p>\u5982\u679c\u4f60\u5df2\u7ecf\u5728\u672c\u5730\u4f7f\u7528 Git \u4f5c\u4e3a\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u4f60\u53ef\u4ee5\u5c06\u5df2\u6709\u7684\u4ee3\u7801\u5e93\u63a8\u9001\u5230 GitLab \u4e2d\u3002\u9996\u5148\uff0c\u5728\u672c\u5730\u8ba1\u7b97\u673a\u4e0a\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06 Git \u4e0e GitLab \u96c6\u6210\uff1a<\/p>\n<pre>$ git config --global user.email \"you@example.com\"\n$ git config --global user.name \"Your Name\"<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u7136\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06\u672c\u5730\u4ee3\u7801\u5e93\u63a8\u9001\u5230 GitLab \u4e2d\uff1a<\/p>\n<pre>$ git remote add origin git@gitlab.com:username\/project-name.git\n$ git push -u origin master<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<ol>\n<li>\u914d\u7f6e\u9879\u76ee\u7684\u5176\u4ed6\u8bbe\u7f6e<\/li>\n<\/ol>\n<p>\u9664\u4e86\u5e38\u89c4\u9879\u76ee\u8bbe\u7f6e\u4e4b\u5916\uff0cGitLab \u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e9b\u5176\u4ed6\u7684\u9879\u76ee\u8bbe\u7f6e\u3002\u8fd9\u4e9b\u8bbe\u7f6e\u53ef\u4ee5\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u7ba1\u7406\u4f60\u7684\u9879\u76ee\uff0c\u5e76\u786e\u4fdd\u6240\u6709\u5408\u4f5c\u4f19\u4f34\u90fd\u80fd\u591f\u53c2\u4e0e\u5176\u4e2d\u3002\u4f8b\u5982\uff0c\u4f60\u53ef\u4ee5\u542f\u7528\u5408\u5e76\u8bf7\u6c42\u3001\u4ee3\u7801\u5ba1\u67e5\u7b49\u529f\u80fd\u3002<\/p>\n<ol>\n<li>\u6dfb\u52a0\u5176\u4ed6\u56e2\u961f\u6210\u5458<\/li>\n<\/ol>\n<p>\u6700\u540e\uff0c\u4f60\u9700\u8981\u5c06\u5176\u4ed6\u56e2\u961f\u6210\u5458\u6dfb\u52a0\u5230\u4f60\u7684 GitLab \u9879\u76ee\u4e2d\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u8bbf\u95ee\u9879\u76ee\u4e3b\u9875\u7684\u201c\u6210\u5458\u201d\u9009\u9879\u5361\u5b8c\u6210\u3002\u5728\u6b64\u9009\u9879\u5361\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ed6\u4eec\u7684\u7528\u6237\u540d\u6216\u7535\u5b50\u90ae\u4ef6\u5730\u5740\u5c06\u5176\u4ed6\u4eba\u6dfb\u52a0\u5230\u9879\u76ee\u4e2d\u3002\u5f53\u88ab\u9080\u8bf7\u7684\u4eba\u6ce8\u518c GitLab \u5e10\u6237\u5e76\u63a5\u53d7\u9080\u8bf7\u540e\uff0c\u4ed6\u4eec\u5c31\u53ef\u4ee5\u5f00\u59cb\u4e0e\u4f60\u4e00\u8d77\u534f\u4f5c\u5f00\u53d1\u9879\u76ee\u3002<\/p>\n<p>\u603b\u4e4b\uff0c\u521b\u5efa\u548c\u7ba1\u7406\u4f60\u7684\u7b2c\u4e00\u4e2a GitLab \u9879\u76ee\u975e\u5e38\u5bb9\u6613\u3002\u53ea\u9700\u9075\u5faa\u4ee5\u4e0a\u7b80\u5355\u7684\u6b65\u9aa4\uff0c\u4f60\u5c31\u53ef\u4ee5\u5feb\u901f\u4e0a\u624b\uff0c\u5e76\u5f00\u59cb\u5728\u4e00\u4e2a\u56e2\u961f\u4e2d\u5171\u540c\u534f\u4f5c\u5f00\u53d1\u9879\u76ee\u3002\u65e0\u8bba\u4f60\u662f\u4e00\u4e2a\u72ec\u7acb\u5f00\u53d1\u8005\u8fd8\u662f\u4e00\u4e2a\u56e2\u961f\u9886\u5bfc\uff0cGitLab \u90fd\u5c06\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u5408\u4f5c\u5de5\u5177\uff0c\u53ef\u4ee5\u4e3a\u4f60\u7684\u9879\u76ee\u5e26\u6765\u66f4\u9ad8\u6548\u548c\u751f\u4ea7\u7387\u7684\u63d0\u5347\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f7f\u7528 GitLab \u7684\u7b2c\u4e00\u4e2a\u9879\u76ee\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>\u4f5c\u4e3a\u4e00\u4e2a\u5f00\u6e90\u7684\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0cgitlab \u4e3a\u56e2\u961f\u534f\u4f5c\u63d0\u4f9b\u4e86\u5b8c\u7f8e\u7684\u89e3\u51b3\u65b9\u6848\u3002\u5b83\u4e0d\u4ec5\u53ef\u4ee5\u652f\u6301\u4ee3\u7801\u7ba1\u7406\uff0c\u8fd8\u80fd\u591f\u5728\u6574\u4e2a\u8f6f\u4ef6\u5f00\u53d1\u5468\u671f\u4e2d\u8fdb\u884c\u591a\u79cd\u534f\u4f5c\u529f\u80fd\uff0c\u5982\u95ee\u9898\u8ddf\u8e2a\u3001\u4ee3\u7801\u5ba1\u67e5\u7b49\u3002 \u90a3\u4e48\uff0c\u8fd9\u7bc7\u6587\u7ae0\u7684\u4e3b\u8981\u76ee\u7684\u662f\u6559\u4f60\u5982\u4f55\u4f7f\u7528 GitLab \u7684\u7b2c\u4e00\u4e2a\u9879\u76ee\u3002\u4ee5\u4e0b\u662f\u5177\u4f53\u7684\u6b65\u9aa4\uff1a \u521b\u5efa\u4e00\u4e2a GitLab \u5e10\u53f7 \u8981\u4f7f\u7528 GitLab\uff0c\u4f60\u9700\u8981\u5148\u521b\u5efa\u4e00\u4e2a\u5e10\u53f7\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u8bbf\u95ee GitLab \u5b98\u65b9\u7f51\u7ad9\u5b8c\u6210\u3002\u4e00\u65e6\u5728\u7f51\u7ad9\u4e0a\u6ce8\u518c\u4e86\u5e10\u53f7\uff0c\u4f60\u5c31\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9879\u76ee\u5e76\u5f00\u59cb\u5de5\u4f5c\u3002 \u521b\u5efa\u4e00\u4e2a\u65b0\u9879\u76ee \u5728 GitLab \u4e2d\u521b\u5efa\u65b0\u9879\u76ee\u975e\u5e38\u7b80\u5355\u3002\u5728\u754c\u9762\u7684\u5de6\u4e0a\u65b9\uff0c\u4f60\u53ef\u4ee5\u770b\u5230\u4e00\u4e2a\u65b0\u5efa\u9879\u76ee\u7684\u6309\u94ae\u3002\u70b9\u51fb\u5b83\u540e\uff0c\u4f60\u5c06\u88ab\u5f15\u5bfc\u5230\u4e00\u4e2a\u65b0\u9879\u76ee\u521b\u5efa\u9875\u9762\u3002\u5728\u6b64\u9875\u9762\u4e2d\uff0c\u4f60\u9700\u8981\u8f93\u5165\u9879\u76ee\u540d\u79f0\u3001\u63cf\u8ff0\u548c\u8bbf\u95ee\u6743\u9650\u7b49\u4fe1\u606f\u3002 \u5c06\u672c\u5730\u4ee3\u7801\u4e0a\u4f20\u5230 GitLab \u4e00\u65e6\u4f60\u521b\u5efa\u4e86\u4e00\u4e2a\u65b0\u7684 GitLab \u9879\u76ee\uff0c\u4f60\u53ef\u4ee5\u5c06\u672c\u5730\u4ee3\u7801\u4e0a\u4f20\u5230\u5176\u4e2d\u3002\u5728 GitLab \u9875\u9762\u4e2d\uff0c\u4f60\u53ef\u4ee5\u627e\u5230\u4e00\u4e2a Clone \u6309\u94ae\u3002\u70b9\u51fb\u5b83\u540e\uff0cGitLab \u5c06\u63d0\u793a\u4f60\u4f7f\u7528 SSH \u6216 HTTPS \u4ece\u672c\u5730\u8ba1\u7b97\u673a\u514b\u9686\u5230\u8be5\u9879\u76ee\u3002 \u5982\u679c\u4f60\u5df2\u7ecf\u5728\u672c\u5730\u4f7f\u7528 Git \u4f5c\u4e3a\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u4f60\u53ef\u4ee5\u5c06\u5df2\u6709\u7684\u4ee3\u7801\u5e93\u63a8\u9001\u5230 GitLab \u4e2d\u3002\u9996\u5148\uff0c\u5728\u672c\u5730\u8ba1\u7b97\u673a\u4e0a\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06 Git \u4e0e GitLab \u96c6\u6210\uff1a $ git config &#8211;global user.email &#8220;you@example.com&#8221; $ git config &#8211;global user.name &#8220;Your Name&#8221; \u767b\u5f55\u540e\u590d\u5236 \u7136\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06\u672c\u5730\u4ee3\u7801\u5e93\u63a8\u9001\u5230 GitLab [&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-19732","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19732","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=19732"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19732\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}