{"id":137,"date":"2023-04-28T14:45:33","date_gmt":"2023-04-28T06:45:33","guid":{"rendered":"https:\/\/www.icfyless.com\/?p=137"},"modified":"2023-04-28T14:45:33","modified_gmt":"2023-04-28T06:45:33","slug":"gitlab%e5%9c%a8%e7%ba%bf%e5%90%88%e5%b9%b6%e8%a7%a3%e5%86%b3%e5%86%b2%e7%aa%81%e5%90%8e%e5%8f%8d%e5%90%91%e5%90%88%e5%b9%b6%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/www.icfyless.com\/index.php\/2023\/04\/28\/gitlab%e5%9c%a8%e7%ba%bf%e5%90%88%e5%b9%b6%e8%a7%a3%e5%86%b3%e5%86%b2%e7%aa%81%e5%90%8e%e5%8f%8d%e5%90%91%e5%90%88%e5%b9%b6%e7%9a%84%e9%97%ae%e9%a2%98\/","title":{"rendered":"GitLab\u5728\u7ebf\u5408\u5e76\u89e3\u51b3\u51b2\u7a81\u540e\u53cd\u5411\u5408\u5e76\u7684\u95ee\u9898"},"content":{"rendered":"<h2>GitLab\u5728\u7ebf\u5408\u5e76\u89e3\u51b3\u51b2\u7a81\u540e\u53cd\u5411\u5408\u5e76\u7684\u95ee\u9898<\/h2>\n<h4>1\u3001feature --&gt; test<\/h4>\n<p>\u76ee\u7684\uff1a\u529f\u80fd\u5206\u652f\u5f00\u53d1\u5b8c\u4e4b\u540e\uff0c\u5c06\u529f\u80fd\u5206\u652f\u5408\u5e76\u5230test\u5206\u652f\u8fdb\u884c\u6d4b\u8bd5<\/p>\n<h4>2\u3001\u95ee\u9898\u8be6\u7ec6\u63cf\u8ff0<\/h4>\n<p>\u5728gitlab\u4e0a\u9762\u505a\u5408\u5e76\u64cd\u4f5c\uff0c\u51fa\u73b0\u51b2\u7a81\uff0c\u89e3\u51b3\u51b2\u7a81\u540e\u63d0\u4ea4\uff0c\u786e\u8ba4\u5408\u5e76\uff0c\u53d1\u73b0\u4e24\u4e2a\u5206\u652f\u4e92\u76f8\u5408\u5e76\u4e86\u3002<\/p>\n<p>\u603b\u7ed3\uff1a\u5982\u679c\u4f7f\u7528 Gitlab \u63d0\u4f9b\u5728\u5728\u7ebf\u51b2\u7a81\u89e3\u51b3\u5de5\u5177\u7684\u8bdd\uff0c\u672c\u6765\u662f\u5c06 A --&gt; B \u5408\u5e76\u7684\uff0c\u7ed3\u679c\u53d8\u6210\u4e86\u5148\u8d70 B --&gt; A \u5408\u5e76\uff0c\u518d\u8d70A --&gt; B\uff0c\u5bfc\u81f4\u5206\u652f\u7ba1\u7406\u6df7\u4e71\u3002\uff08\u6709\u51b2\u7a81\u7684\u60c5\u51b5\u624d\u4f1a\u6709\u8fd9\u79cd\u73b0\u8c61\uff09<\/p>\n<h4>3\u3001\u5206\u6790\u4e0e\u89e3\u51b3<\/h4>\n<p>git\u6b63\u5e38\u7684\u5408\u5e76\u5206\u652f\u64cd\u4f5c<\/p>\n<ol>\n<li>\u5207\u6362\u5230\u76ee\u6807\u5206\u652f<\/li>\n<li>\u6267\u884c\u5408\u5e76\u547d\u4ee4\uff0cgit merge\u6e90\u5206\u652f<\/li>\n<li>\u6ca1\u6709\u51b2\u7a81\u5408\u5e76\u7ed3\u675f\uff0c\u51fa\u73b0\u51b2\u7a81\uff0c\u5728\u76ee\u6807\u5206\u652f\u4e0a\u89e3\u51b3\u51b2\u7a81\uff0c\u6267\u884ccommit\u547d\u4ee4\uff0c\u5408\u5e76\u7ed3\u675f<\/li>\n<\/ol>\n<p>gitlab\u505a\u5408\u5e76\u5206\u652f\u7684\u64cd\u4f5c<\/p>\n<ol>\n<li>\n<p>\u65b0\u5efa\u5408\u5e76\u8bf7\u6c42\uff0c\u9009\u62e9\u6e90\u5206\u652f\u548c\u76ee\u6807\u5206\u652f<\/p>\n<\/li>\n<li>\n<p>\u51fa\u73b0\u51b2\u7a81\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528Gitlab\u63d0\u4f9b\u7684\u5728\u7ebf\u51b2\u7a81\u89e3\u51b3\u5de5\u5177\/\u6216\u8005\u53d6\u6d88\u5408\u5e76\u8bf7\u6c42\uff0c\u7528\u672c\u5730\u547d\u4ee4\u5408\u5e76<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528\u5728\u7ebf\u5de5\u5177\u7684\u8bdd\uff0cGitlab\u5b9e\u5728\u6e90\u5206\u652f\u4e0a\u63d0\u4ea4\u6211\u4eec\u89e3\u51b3\u51b2\u7a81\u7684\u4ee3\u7801\uff0c\u6700\u540e\u70b9\u5408\u5e76\u7684\u65f6\u5019\u518d\u628a\u6e90\u5206\u652f\u5408\u5e76\u5230\u76ee\u6807\u5206\u652f\uff0c\u8fd9\u5c31\u5bfc\u81f4\u5408\u5e76\u7ed3\u675f\u540e\uff0c\u6e90\u5206\u652f\u4e0e\u76ee\u6807\u5206\u652f\u51fa\u73b0\u4e92\u76f8\u5408\u5e76\u7684\u60c5\u51b5\uff0c\u5c31\u4ea7\u751f\u5f88\u591a\u5206\u652f\u5408\u5e76\u7ba1\u7406\u4e0a\u7684\u95ee\u9898<\/p>\n<blockquote>\n<p>Note: \u6ce8\u610f: GitLab resolves conflicts by creating a merge commit in the source branch that is not automatically merged into the target branch. This allows the merge commit to be reviewed and tested before the changes are merged, preventing unintended changes entering the target branch without review or breaking the build.<br \/>\nGitlab \u901a\u8fc7\u5728\u6e90\u5206\u652f\u4e2d\u521b\u5efa\u4e00\u4e2a merge commit \u6765\u89e3\u51b3\u51b2\u7a81\uff0c\u8be5\u5206\u652f\u4e0d\u4f1a\u81ea\u52a8\u5408\u5e76\u5230\u76ee\u6807\u5206\u652f\u4e2d\u3002 \u8fd9\u5141\u8bb8\u5728\u5408\u5e76\u66f4\u6539\u4e4b\u524d\u5bf9\u5408\u5e76\u63d0\u4ea4\u8fdb\u884c\u5ba1\u67e5\u548c\u6d4b\u8bd5\uff0c\u4ece\u800c\u9632\u6b62\u610f\u5916\u7684\u66f4\u6539\u8fdb\u5165\u76ee\u6807\u5206\u652f\uff0c\u800c\u65e0\u9700\u5ba1\u67e5\u6216\u4e2d\u65ad\u6784\u5efa<\/p>\n<\/blockquote>\n<\/li>\n<\/ol>\n<h4>4\u3001\u89e3\u51b3\u65b9\u6cd5<\/h4>\n<ol>\n<li>\u5047\u8bbeA\u5206\u652f\u8981\u5408\u5e76\u5230B\u5206\u652f\uff0c\u4e14\u51fa\u73b0\u4e86\u51b2\u7a81\uff0c\u53ef\u4ee5\u5148\u4eceA\u5206\u4e4b\u62c9\u4e00\u4e2a\u4e34\u65f6\u5206\u652fA_bak\u5206\u652f\u5408\u5e76\u5230B\u5206\u652f<\/li>\n<li>\u5047\u8bbeA\u5206\u4e4b\u8981\u5408\u5e76\u5230B\u5206\u652f\uff0c\u4e14\u51fa\u73b0\u4e86\u51b2\u7a81\uff0c\u5408\u5e76\u5b8c\u6210\u4e4b\u540e\uff0c\u5bf9A\u5206\u4e4b\u505a\u56de\u6eda\u64cd\u4f5cgit reset\/ <strong>git revert \u76ee\u6807\u7248\u672c\u53f7<\/strong><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>GitLab\u5728\u7ebf\u5408\u5e76\u89e3\u51b3\u51b2\u7a81\u540e\u53cd\u5411\u5408\u5e76\u7684\u95ee\u9898 1\u3001 &hellip;<\/p>\n","protected":false},"author":1,"featured_media":138,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-137","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-11"],"_links":{"self":[{"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/posts\/137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/comments?post=137"}],"version-history":[{"count":1,"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/posts\/137\/revisions"}],"predecessor-version":[{"id":139,"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/posts\/137\/revisions\/139"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/media\/138"}],"wp:attachment":[{"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/media?parent=137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/categories?post=137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.icfyless.com\/index.php\/wp-json\/wp\/v2\/tags?post=137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}