{"id":19468,"date":"2024-11-19T09:09:47","date_gmt":"2024-11-19T01:09:47","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19468\/"},"modified":"2024-11-19T09:09:47","modified_gmt":"2024-11-19T01:09:47","slug":"%e6%80%8e%e4%b9%88%e6%8a%8a%e4%bb%a3%e7%a0%81%e4%b8%8a%e4%bc%a0%e5%88%b0gitlab","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19468\/","title":{"rendered":"\u600e\u4e48\u628a\u4ee3\u7801\u4e0a\u4f20\u5230gitlab"},"content":{"rendered":"<p>\u5728gitlab\u4e0a\u4e0a\u4f20\u4ee3\u7801\u662f\u4e00\u4ef6\u975e\u5e38\u65b9\u4fbf\u5feb\u6377\u7684\u4e8b\u60c5\u3002\u53ea\u9700\u8981\u7b80\u5355\u51e0\u6b65\u5c31\u53ef\u4ee5\u6210\u529f\u4e0a\u4f20\u4ee3\u7801\u4e86\u3002\u4e0b\u9762\uff0c\u6211\u4eec\u4e00\u8d77\u6765\u770b\u770b\uff0c\u600e\u4e48\u628a\u4f60\u7684\u4ee3\u7801\u4e0a\u4f20\u5230gitlab\u5427\u3002<\/p>\n<p>\u7b2c\u4e00\u6b65\uff0c\u901a\u8fc7Git\u5c06\u4ee3\u7801\u4e0a\u4f20\u5230\u8fdc\u7a0b\u4ee3\u7801\u5e93\uff1a<\/p>\n<p>\u9996\u5148\uff0c\u5728\u4f60\u7684\u672c\u5730\u4ee3\u7801\u4ed3\u5e93\u4e2d\u6253\u5f00Git Bash\u7ec8\u7aef\u3002\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5c06\u4ee3\u7801\u4e0eGitLab\u4e0a\u7684\u8fdc\u7a0b\u4ee3\u7801\u5e93\u5173\u8054\u8d77\u6765\uff1a<\/p>\n<pre>git remote add origin [remote repository URL]<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5176\u4e2d\uff0c[remote repository URL]\u662fGitLab\u7684\u8fdc\u7a0b\u4ee3\u7801\u5e93\u7684\u7f51\u5740\u3002<\/p>\n<p>\u63a5\u7740\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06\u672c\u5730\u4ee3\u7801\u63a8\u9001\u5230GitLab\u7684\u8fdc\u7a0b\u4ee3\u7801\u5e93\u4e2d\uff1a<\/p>\n<pre>git push -u origin master<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u91cc\uff0c\u6211\u4eec\u5c06\u672c\u5730\u4ee3\u7801\u7684master\u5206\u652f\u63a8\u9001\u5230GitLab\u7684\u8fdc\u7a0b\u4ee3\u7801\u5e93\u4e2d\u3002\u5982\u679c\u4f60\u6b63\u5728\u4f7f\u7528\u5176\u4ed6\u5206\u652f\uff0c\u8bf7\u5c06master\u66ff\u6362\u4e3a\u4f60\u6240\u5728\u7684\u5206\u652f\u540d\u3002<\/p>\n<p>\u7b2c\u4e8c\u6b65\uff0c\u521b\u5efa\u9879\u76ee\uff1a<\/p>\n<p>\u5728GitLab\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9879\u76ee\u975e\u5e38\u7b80\u5355\u3002\u9996\u5148\uff0c\u8fdb\u5165\u4f60\u7684dashboard\u9875\u9762\uff0c\u7136\u540e\u5355\u51fbNew project\u6309\u94ae\u3002\u5728\u65b0\u5f39\u51fa\u7684\u9875\u9762\u4e2d\uff0c\u586b\u5199\u65b0\u9879\u76ee\u7684\u540d\u79f0\u548c\u63cf\u8ff0\uff0c\u7136\u540e\u5355\u51fbCreate project\u6309\u952e\u5373\u53ef\u3002<\/p>\n<p>\u7b2c\u4e09\u6b65\uff0c\u521b\u5efa\u5206\u652f\uff1a<\/p>\n<p>\u5728GitLab\u4e2d\uff0c\u4e00\u4e2a\u9879\u76ee\u53ef\u4ee5\u6709\u591a\u4e2a\u5206\u652f\uff0c\u6bcf\u4e2a\u5206\u652f\u5bf9\u5e94\u4e0d\u540c\u7684\u529f\u80fd\u6216\u4fee\u590d\u4e0d\u540c\u7684bug\u3002\u5728\u521b\u5efa\u65b0\u9879\u76ee\u540e\uff0c\u8ba9\u6211\u4eec\u6765\u521b\u5efa\u4e00\u4e9b\u5206\u652f\u5427\u3002<\/p>\n<p>\u9996\u5148\uff0c\u70b9\u51fb\u9879\u76ee\u9875\u9762\u4e0a\u65b9\u7684Repository\u9009\u9879\u5361\u3002\u7136\u540e\uff0c\u5728\u5217\u51fa\u7684\u5206\u652f\u4e2d\uff0c\u70b9\u51fbCreate branch\u6309\u952e\uff0c\u8f93\u5165\u65b0\u5206\u652f\u7684\u540d\u79f0\uff0c\u63a5\u7740\u5355\u51fbCreate branch\u6309\u952e\u3002<\/p>\n<p>\u7b2c\u56db\u6b65\uff0c\u63d0\u4ea4\u4ee3\u7801\uff1a<\/p>\n<p>\u73b0\u5728\uff0c\u4f60\u5df2\u7ecf\u5728GitLab\u4e0a\u521b\u5efa\u4e86\u9879\u76ee\u548c\u5206\u652f\uff0c\u63a5\u4e0b\u6765\u8ba9\u6211\u4eec\u6765\u63d0\u4ea4\u4ee3\u7801\u5427\u3002\u5728GitLab\u4e2d\uff0c\u63d0\u4ea4\u4ee3\u7801\u7684\u65b9\u6cd5\u4e0e\u63d0\u4ea4\u4ee3\u7801\u5230\u5176\u4ed6\u8fdc\u7a0b\u4ee3\u7801\u5e93\u7c7b\u4f3c\u3002\u6b63\u5982\u4e0a\u6587\u6240\u8ff0\uff0c\u5728\u672c\u5730\u4f7f\u7528Git Bash\uff0c\u5728\u63d0\u4ea4\u4ee3\u7801\u4e4b\u524d\uff0c\u5148\u5c06\u4ee3\u7801\u4e0eGitLab\u7684\u8fdc\u7a0b\u4ee3\u7801\u5e93\u5173\u8054\u8d77\u6765\u3002<\/p>\n<p>\u63a5\u7740\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06\u672c\u5730\u4ee3\u7801\u63a8\u9001\u5230\u5728GitLab\u4e0a\u521b\u5efa\u7684\u5206\u652f\u4e2d\uff1a<\/p>\n<pre>git push origin [branch name]<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u91cc\u7684[branch name]\u662f\u4f60\u6240\u63a8\u9001\u7684\u5206\u652f\u540d\u79f0\u3002<\/p>\n<p>\u7b2c\u4e94\u6b65\uff0c\u5408\u5e76\u5206\u652f\uff1a<\/p>\n<p>\u5728GitLab\u4e2d\uff0c\u4ee3\u7801\u7684\u5408\u5e76\u53ef\u4ee5\u901a\u8fc7Web\u754c\u9762\u5b8c\u6210\u3002\u6253\u5f00\u9879\u76ee\u9875\u9762\uff0c\u5355\u51fbMerge request\u6309\u952e\u3002\u5728\u65b0\u5f39\u51fa\u7684\u9875\u9762\u4e2d\uff0c\u9009\u62e9\u60a8\u60f3\u8981\u5408\u5e76\u7684\u5206\u652f\uff0c\u7136\u540e\u5355\u51fbSubmit merge request\u6309\u952e\u3002<\/p>\n<p>\u63a5\u7740\uff0c\u9009\u62e9\u4e00\u4e2a\u5408\u9002\u7684\u5408\u5e76\u7b56\u7565\uff0c\u7136\u540e\u5355\u51fbMerge\u6309\u952e\u3002<\/p>\n<p>\u597d\u4e86\uff0c\u8fd9\u5c31\u662f\u628a\u4f60\u7684\u4ee3\u7801\u4e0a\u4f20\u5230GitLab\u7684\u6240\u6709\u6b65\u9aa4\u4e86\u3002\u611f\u8c22\u4f60\u7684\u8010\u5fc3\u9605\u8bfb\u672c\u6587\u3002\u5982\u679c\u8fd8\u6709\u4ec0\u4e48\u4e0d\u6e05\u695a\u7684\u5730\u65b9\uff0c\u6b22\u8fce\u7559\u8a00\u7ed9\u6211\u4eec\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u628a\u4ee3\u7801\u4e0a\u4f20\u5230gitlab\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>\u5728gitlab\u4e0a\u4e0a\u4f20\u4ee3\u7801\u662f\u4e00\u4ef6\u975e\u5e38\u65b9\u4fbf\u5feb\u6377\u7684\u4e8b\u60c5\u3002\u53ea\u9700\u8981\u7b80\u5355\u51e0\u6b65\u5c31\u53ef\u4ee5\u6210\u529f\u4e0a\u4f20\u4ee3\u7801\u4e86\u3002\u4e0b\u9762\uff0c\u6211\u4eec\u4e00\u8d77\u6765\u770b\u770b\uff0c\u600e\u4e48\u628a\u4f60\u7684\u4ee3\u7801\u4e0a\u4f20\u5230gitlab\u5427\u3002 \u7b2c\u4e00\u6b65\uff0c\u901a\u8fc7Git\u5c06\u4ee3\u7801\u4e0a\u4f20\u5230\u8fdc\u7a0b\u4ee3\u7801\u5e93\uff1a \u9996\u5148\uff0c\u5728\u4f60\u7684\u672c\u5730\u4ee3\u7801\u4ed3\u5e93\u4e2d\u6253\u5f00Git Bash\u7ec8\u7aef\u3002\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5c06\u4ee3\u7801\u4e0eGitLab\u4e0a\u7684\u8fdc\u7a0b\u4ee3\u7801\u5e93\u5173\u8054\u8d77\u6765\uff1a git remote add origin [remote repository URL] \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d\uff0c[remote repository URL]\u662fGitLab\u7684\u8fdc\u7a0b\u4ee3\u7801\u5e93\u7684\u7f51\u5740\u3002 \u63a5\u7740\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06\u672c\u5730\u4ee3\u7801\u63a8\u9001\u5230GitLab\u7684\u8fdc\u7a0b\u4ee3\u7801\u5e93\u4e2d\uff1a git push -u origin master \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u91cc\uff0c\u6211\u4eec\u5c06\u672c\u5730\u4ee3\u7801\u7684master\u5206\u652f\u63a8\u9001\u5230GitLab\u7684\u8fdc\u7a0b\u4ee3\u7801\u5e93\u4e2d\u3002\u5982\u679c\u4f60\u6b63\u5728\u4f7f\u7528\u5176\u4ed6\u5206\u652f\uff0c\u8bf7\u5c06master\u66ff\u6362\u4e3a\u4f60\u6240\u5728\u7684\u5206\u652f\u540d\u3002 \u7b2c\u4e8c\u6b65\uff0c\u521b\u5efa\u9879\u76ee\uff1a \u5728GitLab\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9879\u76ee\u975e\u5e38\u7b80\u5355\u3002\u9996\u5148\uff0c\u8fdb\u5165\u4f60\u7684dashboard\u9875\u9762\uff0c\u7136\u540e\u5355\u51fbNew project\u6309\u94ae\u3002\u5728\u65b0\u5f39\u51fa\u7684\u9875\u9762\u4e2d\uff0c\u586b\u5199\u65b0\u9879\u76ee\u7684\u540d\u79f0\u548c\u63cf\u8ff0\uff0c\u7136\u540e\u5355\u51fbCreate project\u6309\u952e\u5373\u53ef\u3002 \u7b2c\u4e09\u6b65\uff0c\u521b\u5efa\u5206\u652f\uff1a \u5728GitLab\u4e2d\uff0c\u4e00\u4e2a\u9879\u76ee\u53ef\u4ee5\u6709\u591a\u4e2a\u5206\u652f\uff0c\u6bcf\u4e2a\u5206\u652f\u5bf9\u5e94\u4e0d\u540c\u7684\u529f\u80fd\u6216\u4fee\u590d\u4e0d\u540c\u7684bug\u3002\u5728\u521b\u5efa\u65b0\u9879\u76ee\u540e\uff0c\u8ba9\u6211\u4eec\u6765\u521b\u5efa\u4e00\u4e9b\u5206\u652f\u5427\u3002 \u9996\u5148\uff0c\u70b9\u51fb\u9879\u76ee\u9875\u9762\u4e0a\u65b9\u7684Repository\u9009\u9879\u5361\u3002\u7136\u540e\uff0c\u5728\u5217\u51fa\u7684\u5206\u652f\u4e2d\uff0c\u70b9\u51fbCreate branch\u6309\u952e\uff0c\u8f93\u5165\u65b0\u5206\u652f\u7684\u540d\u79f0\uff0c\u63a5\u7740\u5355\u51fbCreate branch\u6309\u952e\u3002 \u7b2c\u56db\u6b65\uff0c\u63d0\u4ea4\u4ee3\u7801\uff1a \u73b0\u5728\uff0c\u4f60\u5df2\u7ecf\u5728GitLab\u4e0a\u521b\u5efa\u4e86\u9879\u76ee\u548c\u5206\u652f\uff0c\u63a5\u4e0b\u6765\u8ba9\u6211\u4eec\u6765\u63d0\u4ea4\u4ee3\u7801\u5427\u3002\u5728GitLab\u4e2d\uff0c\u63d0\u4ea4\u4ee3\u7801\u7684\u65b9\u6cd5\u4e0e\u63d0\u4ea4\u4ee3\u7801\u5230\u5176\u4ed6\u8fdc\u7a0b\u4ee3\u7801\u5e93\u7c7b\u4f3c\u3002\u6b63\u5982\u4e0a\u6587\u6240\u8ff0\uff0c\u5728\u672c\u5730\u4f7f\u7528Git Bash\uff0c\u5728\u63d0\u4ea4\u4ee3\u7801\u4e4b\u524d\uff0c\u5148\u5c06\u4ee3\u7801\u4e0eGitLab\u7684\u8fdc\u7a0b\u4ee3\u7801\u5e93\u5173\u8054\u8d77\u6765\u3002 \u63a5\u7740\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06\u672c\u5730\u4ee3\u7801\u63a8\u9001\u5230\u5728GitLab\u4e0a\u521b\u5efa\u7684\u5206\u652f\u4e2d\uff1a git push origin [branch name] \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u91cc\u7684[branch name]\u662f\u4f60\u6240\u63a8\u9001\u7684\u5206\u652f\u540d\u79f0\u3002 \u7b2c\u4e94\u6b65\uff0c\u5408\u5e76\u5206\u652f\uff1a \u5728GitLab\u4e2d\uff0c\u4ee3\u7801\u7684\u5408\u5e76\u53ef\u4ee5\u901a\u8fc7Web\u754c\u9762\u5b8c\u6210\u3002\u6253\u5f00\u9879\u76ee\u9875\u9762\uff0c\u5355\u51fbMerge request\u6309\u952e\u3002\u5728\u65b0\u5f39\u51fa\u7684\u9875\u9762\u4e2d\uff0c\u9009\u62e9\u60a8\u60f3\u8981\u5408\u5e76\u7684\u5206\u652f\uff0c\u7136\u540e\u5355\u51fbSubmit merge request\u6309\u952e\u3002 \u63a5\u7740\uff0c\u9009\u62e9\u4e00\u4e2a\u5408\u9002\u7684\u5408\u5e76\u7b56\u7565\uff0c\u7136\u540e\u5355\u51fbMerge\u6309\u952e\u3002 \u597d\u4e86\uff0c\u8fd9\u5c31\u662f\u628a\u4f60\u7684\u4ee3\u7801\u4e0a\u4f20\u5230GitLab\u7684\u6240\u6709\u6b65\u9aa4\u4e86\u3002\u611f\u8c22\u4f60\u7684\u8010\u5fc3\u9605\u8bfb\u672c\u6587\u3002\u5982\u679c\u8fd8\u6709\u4ec0\u4e48\u4e0d\u6e05\u695a\u7684\u5730\u65b9\uff0c\u6b22\u8fce\u7559\u8a00\u7ed9\u6211\u4eec\u3002 \u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u628a\u4ee3\u7801\u4e0a\u4f20\u5230gitlab\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/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-19468","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19468","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=19468"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19468\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}