{"id":9802,"date":"2023-03-10T12:40:34","date_gmt":"2023-03-10T04:40:34","guid":{"rendered":"http:\/\/123.57.164.21\/?p=9802"},"modified":"2024-11-29T18:01:24","modified_gmt":"2024-11-29T10:01:24","slug":"git%e5%9f%ba%e7%a1%80-git-merge%e4%bd%bf%e7%94%a8%e7%ae%80%e4%bb%8b","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=9802","title":{"rendered":"git\u57fa\u7840 git merge\u4f7f\u7528\u7b80\u4ecb"},"content":{"rendered":"\n<p>\u5728Git\u4e2dmerge\u662f\u7528\u6765\u628a\u5206\u53c9\u7684\u63d0\u4ea4\u5386\u53f2\u653e\u56de\u5230\u4e00\u8d77\u7684\u65b9\u5f0f\u3002git merge\u547d\u4ee4\u7528\u6765\u5c06\u4f60\u4e4b\u524d\u4f7f\u7528git branch\u547d\u4ee4\u521b\u5efa\u7684\u5206\u652f\u4ee5\u53ca\u5728\u6b64\u5206\u652f\u4e0a\u72ec\u7acb\u5f00\u53d1\u7684\u5185\u5bb9\u6574\u5408\u4e3a\u4e00\u4e2a\u5206\u652f\u3002<\/p>\n\n\n\n<p>\u8bf7\u6ce8\u610f\u4e0b\u9762\u7684\u6240\u6709\u547d\u4ee4\u90fd\u4f1a\u662f\u5c06\u5176\u4ed6\u5206\u652f\u5408\u5e76\u5230\u5f53\u524d\u6240\u5728\u5de5\u4f5c\u5206\u652f\u4e0a\u3002\u5f53\u524d\u5de5\u4f5c\u5206\u652f\u7684\u5185\u5bb9\u4f1a\u7531\u4e8emerge\u64cd\u4f5c\u4ea7\u751f\u66f4\u65b0\uff0c\u4f46\u662f\u76ee\u6807\u5206\u652f\u5219\u5b8c\u5168\u4e0d\u53d7\u5f71\u54cd\u3002\u518d\u6b21\u5f3a\u8c03\uff0c\u8fd9\u610f\u5473\u7740git merge\u901a\u5e38\u4e0e\u5176\u4ed6\u51e0\u4e2a<a rel=\"noreferrer noopener\" href=\"https:\/\/so.csdn.net\/so\/search?q=git%E5%91%BD%E4%BB%A4&amp;spm=1001.2101.3001.7020\" target=\"_blank\">git\u547d\u4ee4<\/a>\u4e00\u8d77\u4f7f\u7528\uff0c\u5305\u62ec\u4f7f\u7528<code>git checkout<\/code>\u547d\u4ee4\u6765\u9009\u62e9\u5f53\u524d\u5de5\u4f5c\u5206\u652f\uff0c\u4ee5\u53ca\u4f7f\u7528<code>git branch -d<\/code>\u547d\u4ee4\u6765\u5220\u9664\u5df2\u7ecf\u5408\u5e76\u8fc7\u7684\u5e9f\u5f03\u5206\u652f\u3002<\/p>\n\n\n\n<p><strong>\u4e8b\u524d\u8865\u5145<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><code>git merge<\/code> \u662f\u4e00\u79cd\u5c06\u4e24\u4e2a\u5206\u652f\u7684\u66f4\u6539\u6574\u5408\u5230\u4e00\u8d77\u7684\u65b9\u6cd5\u3002\u5b83\u7684\u6838\u5fc3\u5de5\u4f5c\u662f\uff1a<\/p>\n\n\n\n<ul>\n<li>\u6bd4\u8f83\u4e24\u4e2a\u5206\u652f\u7684 <strong>\u63d0\u4ea4\u5386\u53f2\uff08commits\uff09<\/strong>\u3002<\/li>\n\n\n\n<li>\u627e\u5230\u5b83\u4eec\u7684 <strong>\u5171\u540c\u7956\u5148\u63d0\u4ea4\uff08merge base\uff09<\/strong>\u3002<\/li>\n\n\n\n<li>\u8ba1\u7b97\u4ece\u5171\u540c\u7956\u5148\u5230\u4e24\u4e2a\u5206\u652f\u5404\u81ea\u6700\u65b0\u63d0\u4ea4\u7684\u5dee\u5f02\u3002<\/li>\n\n\n\n<li>\u5c06\u8fd9\u4e9b\u5dee\u5f02\u5408\u5e76\u5230\u76ee\u6807\u5206\u652f\uff0c\u751f\u6210\u4e00\u4e2a\u65b0\u7684\u63d0\u4ea4\uff08\u5982\u679c\u9700\u8981\uff09\u3002<\/li>\n\n\n\n<li><strong>\u65e0\u51b2\u7a81<\/strong>\uff1aGit \u4f1a\u81ea\u52a8\u5408\u5e76\uff0c\u5e76\u751f\u6210\u4e00\u4e2a\u65b0\u7684\u5408\u5e76\u63d0\u4ea4\uff08merge commit\uff09\uff0c\u8868\u793a\u4e24\u4e2a\u5206\u652f\u7684\u5386\u53f2\u5df2\u7ed3\u5408\u3002<\/li>\n\n\n\n<li><strong>\u6709\u51b2\u7a81<\/strong>\uff1aGit \u4f1a\u505c\u6b62\u5e76\u63d0\u793a\u4f60\u624b\u52a8\u89e3\u51b3\u51b2\u7a81\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u6848\u4f8b<\/strong><\/p>\n\n\n\n<p>\u5047\u8bbe\u5f53\u524d\u7684 <code>main<\/code> \u548c <code>feature<\/code> \u5206\u652f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">    A---B---C (main)\n         \\\n          D---E---F (feature)<\/pre>\n\n\n\n<p><strong>\u5171\u540c\u7956\u5148<\/strong>\uff1a<code>B<\/code> \u662f <code>main<\/code> \u548c <code>feature<\/code> \u7684\u5171\u540c\u7956\u5148\u3002<strong>\u5dee\u5f02\u8ba1\u7b97<\/strong>\uff1a<\/p>\n\n\n\n<ul>\n<li>\u4ece <code>B -> C<\/code> \u7684\u66f4\u6539\uff08main \u7684\u66f4\u6539\uff09\u3002<\/li>\n\n\n\n<li>\u4ece <code>B -> F<\/code> \u7684\u66f4\u6539\uff08feature \u7684\u66f4\u6539\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u5408\u5e76<\/strong>\uff1a<\/p>\n\n\n\n<ul>\n<li>Git \u5c06 <code>main<\/code> \u548c <code>feature<\/code> \u7684\u66f4\u6539\u5408\u5e76\uff0c\u751f\u6210\u4e00\u4e2a\u65b0\u7684\u63d0\u4ea4 <code>G<\/code>\u3002<\/li>\n\n\n\n<li>\u5408\u5e76\u7ed3\u679c\u5982\u4e0b\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">    A---B---C---G (main)\n         \\       \/\n          D---E---F (feature)\n<\/pre>\n\n\n\n<p><strong>\u4e3a\u4ec0\u4e48 Git merge \u4e0d\u6bd4\u8f83\u5b8c\u6574\u6587\u4ef6\uff1f<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>1. Git \u7684\u7248\u672c\u7ba1\u7406\u57fa\u4e8e\u63d0\u4ea4\u5386\u53f2<\/strong><\/p>\n\n\n\n<ul>\n<li>Git \u7684\u6838\u5fc3\u662f\u4e00\u79cd\u201c\u63d0\u4ea4\u70b9\u201d\u6a21\u578b\uff0c\u6bcf\u6b21\u63d0\u4ea4\u8bb0\u5f55\u4e86\u9879\u76ee\u7684\u6574\u4e2a\u72b6\u6001\uff08\u6587\u4ef6\u7684\u5feb\u7167\uff09\u3002<\/li>\n\n\n\n<li>\u5728\u5206\u652f\u5408\u5e76\u65f6\uff0cGit \u901a\u8fc7 <strong>\u63d0\u4ea4\u5386\u53f2<\/strong> \u548c <strong>\u5dee\u5f02\uff08diff\uff09<\/strong> \u6765\u63a8\u5bfc\u51fa\u53d8\u5316\uff0c\u800c\u4e0d\u9700\u8981\u91cd\u65b0\u6bd4\u8f83\u6bcf\u4e2a\u6587\u4ef6\u7684\u5b8c\u6574\u5185\u5bb9\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>2. \u5408\u5e76\u57fa\u4e8e\u201c\u5171\u540c\u7956\u5148\u63d0\u4ea4\u201d<\/strong><\/p>\n\n\n\n<ul>\n<li><strong>\u5171\u540c\u7956\u5148\u63d0\u4ea4<\/strong> \u662f\u4e24\u4e2a\u5206\u652f\u5f00\u59cb\u5206\u53c9\u7684\u70b9\u3002Git \u53ea\u9700\u5bf9\u6bd4\uff1a\n<ul>\n<li>\u4ece\u5171\u540c\u7956\u5148\u63d0\u4ea4\u5230\u5f53\u524d\u5206\u652f\u5934\u90e8\u7684\u5dee\u5f02\u3002<\/li>\n\n\n\n<li>\u4ece\u5171\u540c\u7956\u5148\u63d0\u4ea4\u5230\u88ab\u5408\u5e76\u5206\u652f\u5934\u90e8\u7684\u5dee\u5f02\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>\u8fd9\u6781\u5927\u5730\u51cf\u5c11\u4e86\u9700\u8981\u6bd4\u8f83\u7684\u8303\u56f4\uff0c\u800c\u65e0\u9700\u9010\u884c\u6bd4\u8f83\u4e24\u4e2a\u5206\u652f\u7684\u6240\u6709\u6587\u4ef6\u5185\u5bb9\u3002<\/p>\n\n\n\n<p><strong>\u4e0e\u76f4\u63a5\u6bd4\u8f83\u5b8c\u6574\u6587\u4ef6\u7684\u533a\u522b<\/strong><\/p>\n\n\n\n<p><strong>\u76f4\u63a5\u6bd4\u8f83\u5b8c\u6574\u6587\u4ef6\u7684\u52a3\u52bf<\/strong><\/p>\n\n\n\n<ul>\n<li>\u5982\u679c\u76f4\u63a5\u6bd4\u8f83\u4e24\u4e2a\u5206\u652f\u7684\u5b8c\u6574\u6587\u4ef6\uff0cGit \u6bcf\u6b21\u5408\u5e76\u90fd\u9700\u8981\u8bfb\u53d6\u548c\u5206\u6790\u6bcf\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9\uff0c\u6548\u7387\u4f4e\u4e0b\u3002<\/li>\n\n\n\n<li>\u8fd9\u4e0e Git \u7684\u201c\u589e\u91cf\u5b58\u50a8\u201d\u548c\u201c\u63d0\u4ea4\u5386\u53f2\u201d\u8bbe\u8ba1\u7406\u5ff5\u4e0d\u7b26\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u57fa\u4e8e\u63d0\u4ea4\u5386\u53f2\u7684\u4f18\u52bf<\/strong><\/p>\n\n\n\n<ul>\n<li><strong>\u9ad8\u6548<\/strong>\uff1aGit \u53ea\u9700\u5904\u7406\u589e\u91cf\u7684\u66f4\u6539\uff0c\u800c\u975e\u6bcf\u6b21\u91cd\u65b0\u6bd4\u8f83\u6240\u6709\u6587\u4ef6\u3002<\/li>\n\n\n\n<li><strong>\u51c6\u786e<\/strong>\uff1a\u901a\u8fc7\u63d0\u4ea4\u5386\u53f2\uff0cGit \u77e5\u9053\u6bcf\u4e2a\u66f4\u6539\u7684\u6765\u6e90\u548c\u903b\u8f91\u5173\u7cfb\uff0c\u80fd\u591f\u66f4\u667a\u80fd\u5730\u89e3\u51b3\u6f5c\u5728\u51b2\u7a81\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u603b\u7ed3<\/strong><\/p>\n\n\n\n<ul>\n<li><strong><code>git merge<\/code> \u57fa\u4e8e\u63d0\u4ea4\u5386\u53f2\uff0c\u4e0d\u76f4\u63a5\u6bd4\u8f83\u5206\u652f\u7684\u5b8c\u6574\u6587\u4ef6\u3002<\/strong><\/li>\n\n\n\n<li>Git \u901a\u8fc7\u627e\u5230\u5206\u652f\u7684 <strong>\u5171\u540c\u7956\u5148\u63d0\u4ea4<\/strong> \u548c <strong>\u589e\u91cf\u66f4\u6539\uff08diff\uff09<\/strong> \u6765\u5408\u5e76\uff0c\u800c\u4e0d\u662f\u9010\u884c\u626b\u63cf\u6240\u6709\u6587\u4ef6\u5185\u5bb9\u3002<\/li>\n\n\n\n<li>\u8fd9\u79cd\u673a\u5236\u6548\u7387\u66f4\u9ad8\uff0c\u540c\u65f6\u4fbf\u4e8e\u8ffd\u8e2a\u548c\u89e3\u51b3\u51b2\u7a81\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u4e00\u3001\u6982\u8ff0<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>\u672c\u6587\u662f\u5173\u4e8egit merge\u547d\u4ee4\u7684\u6982\u89c8\u3002\u5728\u4f7f\u7528Git\u7684\u8fc7\u7a0b\u4e2d\uff0c\u5408\u5e76\u662f\u975e\u5e38\u91cd\u8981\u7684\u64cd\u4f5c\u3002\u672c\u6587\u8ba8\u8bba\u4e86\u5408\u5e76\u64cd\u4f5c\u80cc\u540e\u7684\u673a\u5236\uff0c\u4ee5\u53ca\u5feb\u8fdb\u5408\u5e76\u4e0e\u4e09\u8def\u5408\u5e76\u7684\u533a\u522b\u3002\u9700\u8981\u8bfb\u8005\u8bb0\u4f4f\u7684\u8981\u70b9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ul>\n<li>Git \u5408\u5e76\u6d41\u7a0b\u662f\u628a\u4e0d\u540c\u7684\u63d0\u4ea4\u5e8f\u5217\u5408\u5e76\u5230\u4e00\u4e2a\u7edf\u4e00\u7684\u63d0\u4ea4\u5386\u53f2\u4e2d<\/li>\n\n\n\n<li>Git\u5408\u5e76\u8fc7\u7a0b\u4e2d\u6709\u4e24\u4e2a\u4e3b\u8981\u7684\u65b9\u5f0f\uff1a\u5feb\u8fdb\u5408\u5e76 \u548c \u4e09\u8def\u5408\u5e76<\/li>\n\n\n\n<li>\u9664\u975e\u4e24\u4e2a\u63d0\u4ea4\u5e8f\u5217\u4e2d\u51fa\u73b0\u51b2\u7a81\uff0cGit\u901a\u5e38\u53ef\u4ee5\u81ea\u52a8\u5bf9\u63d0\u4ea4\u8fdb\u884c\u5408\u5e76<\/li>\n<\/ul>\n\n\n\n<p><strong>\u4e8c\u3001\u5982\u4f55\u8fd0\u884c\u7684<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>git merge\u4f1a\u5c06\u591a\u4e2a\u63d0\u4ea4\u5e8f\u5217\u5408\u5e76\u8fdb\u4e00\u4e2a\u7edf\u4e00\u7684\u63d0\u4ea4\u5386\u53f2\u3002\u5728\u6700\u5e38\u89c1\u7684\u4f7f\u7528\u573a\u666f\u4e2d\uff0cgit merge\u88ab\u7528\u6765\u5408\u5e76\u4e24\u4e2a\u5206\u652f\u3002\u5728\u672c\u6587\u6863\u63a5\u4e0b\u6765\u7684\u90e8\u5206\uff0c\u6211\u4eec\u4f1a\u4e13\u6ce8\u4e8e\u8fd9\u79cd\u5408\u5e76\u573a\u666f\u3002\u5728\u8fd9\u79cd\u573a\u666f\u4e2d\uff0cgit merge\u63a5\u53d7\u4e24\u4e2acommit\u6307\u9488\uff0c\u901a\u5e38\u662f\u4e24\u4e2a\u5206\u652f\u7684\u9876\u90e8commit\uff0c\u7136\u540e\u5411\u524d\u8ffd\u6eaf\u5230\u8fd9\u4e24\u4e2a\u5206\u652f\u6700\u8fd1\u7684\u4e00\u4e2a\u5171\u540c\u63d0\u4ea4\u3002\u4e00\u65e6\u627e\u5230\u8fd9\u4e2a\u5171\u540c\u63d0\u4ea4\uff0cGit\u5c31\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684&#8221;merge commit&#8221;\uff0c\u7528\u6765\u5408\u5e76\u4e24\u4e2a\u5206\u652f\u4e0a\u5404\u81ea\u7684\u63d0\u4ea4\u5e8f\u5217\u3002<\/p>\n\n\n\n<p>\u6bd4\u5982\u8bf4\u6211\u4eec\u6709\u4e00\u4e2a\u529f\u80fd\u5206\u652f\u7531main\u5206\u652f\u6d3e\u751f\u51fa\u6765\uff0c\u73b0\u5728\u6211\u4eec\u5e0c\u671b\u5c06\u8fd9\u4e2a\u529f\u80fd\u5206\u652f\u5408\u5e76\u56demain\u5206\u652f\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"545\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-1024x545.png\" alt=\"\" class=\"wp-image-9803\" style=\"width:476px;height:253px\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-1024x545.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-300x160.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-768x408.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-830x441.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-230x122.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-350x186.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-480x255.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247.png 1286w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>\u6267\u884c\u5408\u5e76\u547d\u4ee4\u4f1a\u5c06\u6307\u5b9a\u5206\u652f\u5408\u5e76\u5230\u5f53\u524d\u5de5\u4f5c\u5206\u652f\u4e0a\uff0c\u6211\u4eec\u5047\u8bbe\u5f53\u524d\u5de5\u4f5c\u5206\u652f\u4e3amain\u3002Git\u6839\u636e\u4e24\u4e2a\u5206\u652f\u81ea\u884c\u51b3\u5b9a\u5408\u5e76\u63d0\u4ea4\u7684\u7b97\u6cd5\uff08\u5c06\u5728\u4e0b\u9762\u5177\u4f53\u8ba8\u8bba\uff09\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"589\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-1-1024x589.png\" alt=\"\" class=\"wp-image-9804\" style=\"width:480px;height:276px\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-1-1024x589.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-1-300x173.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-1-768x442.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-1-830x477.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-1-230x132.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-1-350x201.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-1-480x276.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-1.png 1502w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>\u5408\u5e76commit\u4e0e\u666e\u901acommit\u4e0d\u4e00\u6837\uff0c\u56e0\u4e3a\u5408\u5e76commit\u4f1a\u6709\u4e24\u4e2a\u7236\u63d0\u4ea4\u3002\u521b\u5efa\u4e00\u4e2a\u5408\u5e76commit\u65f6Git\u4f1a\u5c1d\u8bd5\u81ea\u52a8\u5c06\u4e24\u4e2a\u72ec\u7acb\u7684\u63d0\u4ea4\u5386\u53f2\u5408\u5e76\u4e3a\u4e00\u4e2a\u3002\u4e0d\u8fc7\u5f53Git\u53d1\u73b0\u67d0\u4e00\u5757\u6570\u636e\u5728\u4e24\u8fb9\u7684\u63d0\u4ea4\u5386\u53f2\u4e2d\u90fd\u542b\u6709\u53d8\u66f4\uff0c\u5b83\u5c06\u65e0\u6cd5\u81ea\u52a8\u5bf9\u5176\u8fdb\u884c\u5408\u5e76\u3002\u8fd9\u79cd\u60c5\u51b5\u88ab\u79f0\u4e3a\u7248\u672c\u51b2\u7a81\uff0c\u6b64\u65f6Git\u9700\u8981\u4eba\u4e3a\u4ecb\u5165\u8c03\u6574\u624d\u80fd\u7ee7\u7eed\u8fdb\u884c\u5408\u5e76\u3002<\/p>\n\n\n\n<p><strong>\u4e09\u3001\u6ce8\u610f\u4e8b\u9879<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<ul>\n<li>\u786e\u8ba4\u63a5\u6536\u5408\u5e76\u7684\u5206\u652f<\/li>\n<\/ul>\n\n\n\n<p>\u6267\u884c<code>git status<\/code>\u547d\u4ee4\u67e5\u770b\u5f53\u524d\u5206\u652f\u7684\u72b6\u6001\uff0c<strong>\u786e\u4fddHEAD\u6307\u6b63\u6307\u5411\u7684\u662f\u6b63\u786e\u7684\u63a5\u6536\u5408\u5e76\u7684\u5206\u652f<\/strong>\u3002\u5982\u679c\u4e0d\u662f\uff0c\u6267\u884cgit checkout\u547d\u4ee4\u5207\u6362\u5230\u6b63\u786e\u7684\u5206\u652f\u3002\u5728\u6211\u4eec\u7684\u793a\u4f8b\u4e2d\uff0c\u6267\u884c<code>git checkout main<\/code>\u3002<\/p>\n\n\n\n<ul>\n<li>\u83b7\u53d6\u6700\u65b0\u7684\u8fdc\u7a0b\u63d0\u4ea4<\/li>\n<\/ul>\n\n\n\n<p>\u786e\u4fdd\u5408\u5e76\u64cd\u4f5c\u6d89\u53ca\u7684\u4e24\u4e2a\u5206\u652f\u90fd\u66f4\u65b0\u5230\u8fdc\u7a0b\u4ed3\u5e93\u7684\u6700\u65b0\u72b6\u6001\u3002\u6267\u884c<code>git fetch<\/code>\u62c9\u53d6\u8fdc\u7a0b\u4ed3\u5e93\u7684\u6700\u65b0\u63d0\u4ea4\u3002\u4e00\u65e6fetch\u64cd\u4f5c\u5b8c\u6210\uff0c\u4e3a\u4e86\u4fdd\u8bc1main\u5206\u652f\u4e0e\u8fdc\u7a0b\u5206\u652f\u540c\u6b65\uff0c\u8fd8\u9700\u6267\u884c<code>git pull<\/code>\u547d\u4ee4\u3002<\/p>\n\n\n\n<ul>\n<li>\u5408\u5e76<\/li>\n<\/ul>\n\n\n\n<p>\u5f53\u4e0a\u9762\u63d0\u53ca\u7684\u51c6\u5907\u5de5\u4f5c\u90fd\u5df2\u5b8c\u5907\uff0c\u5408\u5e76\u5c31\u53ef\u4ee5\u6b63\u5f0f\u5f00\u59cb\u4e86\u3002\u6267\u884c<code>git merge &lt;branch&gt;<\/code>\u547d\u4ee4\uff0c\u5176\u4e2d\u4e3a\u9700\u8981\u5408\u5e76\u5230\u5f53\u524d\u5206\u652f\u7684\u76ee\u6807\u5206\u652f\u540d\u79f0\u3002<\/p>\n\n\n\n<p><strong>\u56db\u3001\u5feb\u8fdb\u5408\u5e76<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>\u5f53\u524d\u5de5\u4f5c\u5206\u652f\u5230\u5408\u5e76\u76ee\u6807\u5206\u652f\u4e4b\u95f4\u7684\u63d0\u4ea4\u5386\u53f2\u662f<strong>\u7ebf\u6027\u8def\u5f84<\/strong>\u65f6\uff0c\u53ef\u4ee5\u8fdb\u884c\u5feb\u8fdb\u5408\u5e76\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4e0d\u9700\u8981\u771f\u5b9e\u7684\u5408\u5e76\u4e24\u4e2a\u5206\u652f\uff0cGit\u53ea\u9700\u8981\u628a\u5f53\u524d\u5206\u652f\u7684\u9876\u7aef\u6307\u9488\u79fb\u52a8\u5230\u76ee\u6807\u5206\u652f\u7684\u9876\u7aef\u5c31\u53ef\u4ee5\u4e86\uff08\u4e5f\u5c31\u662f\u5feb\u8fdb\u7684\u610f\u601d\uff09\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u5feb\u8fdb\u5408\u5e76\u6210\u529f\u7684\u5c06\u63d0\u4ea4\u5386\u53f2\u5408\u5e76\u81f3\u4e00\u5904\uff0c\u6bd5\u7adf\u76ee\u6807\u5206\u652f\u4e2d\u7684\u63d0\u4ea4\u6b64\u65f6\u90fd\u5305\u542b\u5728\u5f53\u524d\u5206\u652f\u7684\u63d0\u4ea4\u5386\u53f2\u4e2d\u4e86\u3002\u5bf9\u4e8e\u5c06\u529f\u80fd\u5206\u652f\u5feb\u8fdb\u5408\u5e76\u5230main\u5206\u652f\u7684\u6d41\u7a0b\u53ef\u4ee5\u53c2\u89c1\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"596\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-2-1024x596.png\" alt=\"\" class=\"wp-image-9806\" style=\"width:490px;height:284px\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-2-1024x596.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-2-300x175.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-2-768x447.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-2-830x483.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-2-230x134.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-2-350x204.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-2-480x279.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-2.png 1272w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"585\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-3-1024x585.png\" alt=\"\" class=\"wp-image-9807\" style=\"width:477px;height:272px\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-3-1024x585.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-3-300x171.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-3-768x439.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-3-830x474.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-3-230x131.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-3-350x200.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-3-480x274.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-3.png 1404w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>\u7136\u800c\u5feb\u8fdb\u5408\u5e76\u5728\u4e24\u4e2a\u5206\u652f\u51fa\u73b0\u5206\u53c9\u7684\u60c5\u51b5\u4e0b\u662f\u4e0d\u5141\u8bb8\u6267\u884c\u7684\u3002\u5f53\u76ee\u6807\u5206\u652f\u76f8\u5bf9\u4e8e\u5f53\u524d\u5206\u652f\u7684\u63d0\u4ea4\u5386\u53f2\u4e0d\u662f\u7ebf\u6027\u7684\uff0cGit\u53ea\u80fd\u901a\u8fc7\u4e09\u8def\u5408\u5e76\u7b97\u6cd5\u6765\u51b3\u5b9a\u5982\u4f55\u5bf9\u4e24\u4e2a\u5206\u652f\u8fdb\u884c\u5408\u5e76\u3002\u4e09\u8def\u5408\u5e76\u7b97\u6cd5\u9700\u8981\u4f7f\u7528\u4e00\u4e2a\u4e13\u7528commit\u6765\u6574\u5408\u4e24\u8fb9\u7684\u63d0\u4ea4\u5386\u53f2\u3002\u8fd9\u4e2a\u540d\u8bcd\u6e90\u4e8eGit\u8981\u60f3\u751f\u6210\u5408\u5e76commit\uff0c\u9700\u8981\u7528\u5230\u4e09\u4e2acommits\uff1a\u4e24\u4e2a\u5206\u652f\u7684\u9876\u7aefcommit\uff0c\u4ee5\u53ca\u5b83\u4eec\u7684\u5171\u540c\u7956\u5148commit\u3002<\/p>\n\n\n\n<p>\u5176\u5b9e\u5c31\u662fmain\u4e3b\u5206\u652f\u4e5f\u51fa\u73b0\u4e86\u65b0\u63d0\u4ea4\u3002\u9664\u4e86\u4e09\u8def\u5408\u5e76\uff0c\u4e5f\u53ef\u4ee5\u5728dev\u5f00\u53d1\u5206\u652f\u4e0acherry-pick main\u5206\u652f\u7684\u65b0\u63d0\u4ea4\uff0c\u4fdd\u6301\u4e24\u8fb9\u540c\u6b65\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"773\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-4-1024x773.png\" alt=\"\" class=\"wp-image-9808\" style=\"width:491px;height:371px\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-4-1024x773.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-4-300x227.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-4-768x580.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-4-830x627.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-4-230x174.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-4-350x264.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-4-480x363.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-4.png 1218w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"639\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-5-1024x639.png\" alt=\"\" class=\"wp-image-9809\" style=\"width:494px;height:308px\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-5-1024x639.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-5-300x187.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-5-768x479.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-5-830x518.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-5-230x143.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-5-350x218.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-5-480x299.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/\u56fe\u7247-5.png 1536w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>\u867d\u7136\u5b9e\u9645\u4e0a\u53ef\u4ee5\u9009\u62e9\u4f7f\u7528\u8fd9\u4e9b\u4e0d\u540c\u7684\u5408\u5e76\u7b56\u7565\uff0c\u4f46\u662f\u5927\u591a\u6570\u5f00\u53d1\u8005\u66f4\u559c\u6b22\u5feb\u8fdb\u5408\u5e76\uff08\u901a\u8fc7\u5229\u7528 rebasing \u547d\u4ee4\uff09\uff0c\u5c24\u5176\u662f\u7528\u4e8e\u5c0f\u529f\u80fd\u7684\u5f00\u53d1\u6216\u8005bug\u4fee\u590d\uff1b\u53cd\u4e4b\u5bf9\u4e8e\u5408\u5e76\u957f\u671f\u5f00\u53d1\u7684\u529f\u80fd\u5206\u652f\uff0c\u5219\u66f4\u503e\u5411\u4e8e\u4f7f\u7528\u4e09\u8def\u5408\u5e76\u7684\u65b9\u5f0f\u3002\u5728\u7b2c\u4e8c\u79cd\u573a\u666f\u4e2d\uff0cmerge\u4ea7\u751f\u7684\u5408\u5e76commit\u4f1a\u4f5c\u4e3a\u4e24\u4e2a\u5206\u652f\u5408\u5e76\u7684\u6807\u5fd7\u4fdd\u7559\u5728\u63d0\u4ea4\u5386\u53f2\u4e2d\u3002<\/p>\n\n\n\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u7528\u4e0b\u9762\u7b2c\u4e00\u4e2a\u4f8b\u5b50\u6765\u5c55\u793a\u5982\u4f55\u8fdb\u884c\u5feb\u8fdb\u5408\u5e76\u3002\u4e0b\u9762\u7684\u547d\u4ee4\u4f1a\u5148\u521b\u5efa\u4e00\u4e2a\u65b0\u5206\u652f\uff0c\u5728\u65b0\u5206\u652f\u4e0a\u8fdb\u884c\u4e24\u6b21\u63d0\u4ea4\uff0c\u7136\u540e\u7528\u5feb\u8fdb\u5408\u5e76\u628a\u65b0\u5206\u652f\u5408\u5e76\u56demain\u5206\u652f\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Start a new feature\ngit checkout -b new-feature main\n# Edit some files\ngit add &lt;file>\ngit commit -m \"Start a feature\"\n# Edit some files\ngit add &lt;file>\ngit commit -m \"Finish a feature\"\n# Merge in the new-feature branch\ngit checkout main\ngit merge new-feature\ngit branch -d new-feature<\/pre>\n\n\n\n<p>\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\u7684\u5de5\u4f5c\u6d41\u7a0b\u901a\u5e38\u7528\u4e8e\u77ed\u671f\u529f\u80fd\u7684\u5f00\u53d1\uff0c\u8fd9\u79cd\u5f00\u53d1\u6d41\u7a0b\u66f4\u591a\u5730\u88ab\u5f53\u505a\u662f\u6bd4\u8f83\u72ec\u7acb\u7684\u4e00\u6b21\u5f00\u53d1\u6d41\u7a0b\uff0c\u4e0e\u4e4b\u5bf9\u5e94\u7684\u5219\u662f\u9700\u8981\u534f\u8c03\u548c\u7ba1\u7406\u7684\u957f\u671f\u529f\u80fd\u5f00\u53d1\u5206\u652f\u3002<\/p>\n\n\n\n<p>\u53e6\u5916\u8fd8\u9700\u6ce8\u610f\u5230\uff0c\u5728\u6b64\u4f8b\u4e2dGit\u4e0d\u4f1a\u5bf9git branch -d\u547d\u4ee4\u53d1\u51fa\u8b66\u544a\uff0c\u56e0\u4e3anew-feature\u7684\u5185\u5bb9\u5df2\u7ecf\u5408\u5e76\u5230\u4e3b\u5206\u652f\u91cc\u4e86\u3002<\/p>\n\n\n\n<p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u867d\u7136\u76ee\u6807\u5206\u652f\u7684\u63d0\u4ea4\u5386\u53f2\u76f8\u5bf9\u4e8e\u5f53\u524d\u5206\u652f\u662f\u7ebf\u6027\u7684\uff0c\u53ef\u4ee5\u8fdb\u884c\u5feb\u8fdb\u5408\u5e76\uff0c\u4f46\u4f60\u4ecd\u7136\u5e0c\u671b\u6709\u4e00\u4e2a\u5408\u5e76commit\u6765\u6807\u5fd7\u5408\u5e76\u5728\u6b64commit\u53d1\u751f\u8fc7\uff0c\u90a3\u4e48\u53ef\u4ee5\u5728\u6267\u884cgit merge\u547d\u4ee4\u65f6\u4f7f\u7528\u2013no-ff\u9009\u9879\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">git merge --no-ff &lt;branch><\/pre>\n\n\n\n<p>\u4ee5\u4e0a\u547d\u4ee4\u5c06\u6307\u5b9a\u5206\u652f\u5408\u5e76\u5230\u5f53\u524d\u5206\u652f\uff0c\u4f46\u603b\u4f1a\u751f\u6210\u4e00\u4e2a\u5408\u5e76commit\uff08\u5373\u4fbf\u8fd9\u4e00\u5408\u5e76\u64cd\u4f5c\u53ef\u4ee5\u5feb\u8fdb\uff09\u3002\u5f53\u4f60\u9700\u8981\u5728\u4ed3\u5e93\u7684\u63d0\u4ea4\u5386\u53f2\u4e2d\u6807\u8bb0\u5408\u5e76\u4e8b\u4ef6\u65f6\u8fd9\u4e00\u547d\u4ee4\u76f8\u5f53\u6709\u7528\u3002<\/p>\n\n\n\n<p><strong>\u4e94\u3001\u4e09\u8def\u5408\u5e76<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>\u63a5\u4e0b\u6765\u7684\u4f8b\u5b50\u4e0e\u4e0a\u9762\u6bd4\u8f83\u50cf\uff0c\u4f46\u662f\u56e0\u4e3amain\u5206\u652f\u5728feature\u5206\u652f\u5411\u524d\u53d1\u5c55\u7684\u8fc7\u7a0b\u4e2d\uff0c\u81ea\u8eab\u4e5f\u53d1\u751f\u7684\u6539\u53d8\uff0c\u56e0\u6b64\u5728\u5408\u5e76\u65f6\u9700\u8981\u8fdb\u884c\u4e09\u8def\u5408\u5e76\u3002\u5728\u8fdb\u884c\u5927\u7684\u529f\u80fd\u5f00\u53d1\u6216\u8005\u6709\u591a\u4e2a\u5f00\u53d1\u8005\u540c\u65f6\u8fdb\u884c\u5f00\u53d1\u65f6\u8fd9\u79cd\u573a\u666f\u76f8\u5f53\u5e38\u89c1\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Start a new feature\ngit checkout -b new-feature main\n# Edit some files\ngit add &lt;file>\ngit commit -m \"Start a feature\"\n# Edit some files\ngit add &lt;file>\ngit commit -m \"Finish a feature\"\n# Develop the main branch\ngit checkout main\n# Edit some files\ngit add &lt;file>\ngit commit -m \"Make some super-stable changes to main\"\n# Merge in the new-feature branch\ngit merge new-feature\ngit branch -d new-feature<\/pre>\n\n\n\n<p>\u9700\u6ce8\u610f\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u7531\u4e8e\u6ca1\u6709\u529e\u6cd5\u76f4\u63a5\u628amain\u7684\u9876\u7aef\u6307\u9488\u79fb\u52a8\u5230new-feature\u5206\u652f\u4e0a\uff0c\u56e0\u6b64Git\u65e0\u6cd5\u6267\u884c\u5feb\u8fdb\u5408\u5e76\u3002<\/p>\n\n\n\n<p>\u5728\u5927\u591a\u6570\u5b9e\u9645\u5de5\u4f5c\u573a\u666f\u4e2d\uff0cnew-feature\u5e94\u8be5\u662f\u4e00\u4e2a\u5f88\u5927\u7684\u529f\u80fd\uff0c\u5f00\u53d1\u8fc7\u7a0b\u6301\u7eed\u4e86\u76f8\u5f53\u957f\u7684\u65f6\u95f4\uff0c\u8fd9\u4e5f\u5c31\u96be\u514d\u540c\u65f6\u671f\u5728main\u5206\u652f\u4e0a\u4e5f\u6709\u65b0\u7684\u63d0\u4ea4\u3002\u5982\u679c\u4f60\u7684\u529f\u80fd\u5206\u652f\u5927\u5c0f\u50cf\u4e0a\u9762\u7684\u4f8b\u5b50\u4e00\u6837\u5c0f\uff0c\u5219\u5b8c\u5168\u53ef\u4ee5\u4f7f\u7528<code>rebase<\/code>\u5c06new-feature\u5206\u652f\u53d8\u57fa\u5230main\u5206\u652f\u4e0a\uff0c\u7136\u540e\u518d\u6267\u884c\u4e00\u6b21\u5feb\u8fdb\u5408\u5e76\u3002\u8fd9\u6837\u4e5f\u4f1a\u907f\u514d\u5728\u9879\u76ee\u63d0\u4ea4\u5386\u53f2\u4e2d\u4ea7\u751f\u8fc7\u591a\u7684\u5197\u4f59\u3002<\/p>\n\n\n\n<p><strong>\u516d\u3001\u89e3\u51b3\u51b2\u7a81<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>\u5982\u679c\u5c06\u8981\u5408\u5e76\u7684\u4e24\u4e2a\u5206\u652f\u90fd\u4fee\u6539\u4e86\u540c\u4e00\u4e2a\u800c\u6587\u4ef6\u7684\u540c\u4e00\u4e2a\u90e8\u5206\u5185\u5bb9\uff0cGit\u5c31\u65e0\u6cd5\u786e\u5b9a\u5e94\u8be5\u4f7f\u7528\u54ea\u4e2a\u7248\u672c\u7684\u5185\u5bb9\u3002\u5f53\u8fd9\u79cd\u60c5\u51b5\u53d1\u751f\u65f6\uff0c\u5408\u5e76\u8fc7\u7a0b\u4f1a\u505c\u6b62\u5728\u5408\u5e76commit\u63d0\u4ea4\u4e4b\u524d\uff0c\u4ee5\u4fbf\u7ed9\u7528\u6237\u7559\u4e0b\u673a\u4f1a\u624b\u52a8\u4fee\u590d\u8fd9\u4e9b\u51b2\u7a81\u3002<\/p>\n\n\n\n<p>\u5728Git\u7684\u5408\u5e76\u8fc7\u7a0b\u4e2d\uff0c\u5f88\u68d2\u7684\u4e00\u70b9\u662f\u5b83\u4f7f\u7528\u4eba\u4eec\u719f\u77e5\u7684 \u7f16\u8f91 \/ \u6682\u5b58 \/ \u63d0\u4ea4 \u8fd9\u6837\u7684\u5de5\u4f5c\u6d41\u7a0b\u6765\u89e3\u51b3\u51b2\u7a81\u3002\u5f53\u78b0\u5230\u5408\u5e76\u51b2\u7a81\u65f6\uff0c\u6267\u884c<code>git status<\/code>\u547d\u4ee4\u4f1a\u5217\u51fa\u54ea\u4e9b\u6587\u4ef6\u542b\u6709\u51b2\u7a81\u5e76\u9700\u8981\u624b\u52a8\u89e3\u51b3\u3002\u6bd4\u5982\u8bf4\u5f53\u4e24\u4e2a\u5206\u652f\u90fd\u4fee\u6539\u4e86hello.py\u6587\u4ef6\u7684\u540c\u4e00\u90e8\u5206\uff0c\u4f60\u4f1a\u770b\u5230\u7c7b\u4f3c\u4e0b\u9762\u8fd9\u6837\u7684\u4fe1\u606f\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">On branch main\nUnmerged paths:\n(use \"git add\/rm ...\" as appropriate to mark resolution)\nboth modified: hello.py<\/pre>\n\n\n\n<p><strong>\u51b2\u7a81\u662f\u5982\u4f55\u663e\u793a\u7684<\/strong><\/p>\n\n\n\n<p>\u5f53Git\u5728\u5408\u5e76\u8fc7\u7a0b\u4e2d\u78b0\u5230\u4e86\u51b2\u7a81\uff0c\u5b83\u4f1a\u7f16\u8f91\u53d7\u5f71\u54cd\u7684\u6587\u4ef6\u4e2d\u7684\u76f8\u5173\u5185\u5bb9\uff0c\u5e76\u6dfb\u52a0\u89c6\u89c9\u6807\u8bb0\u7528\u4ee5\u5c55\u793a\u51b2\u7a81\u4e2d\u53cc\u65b9\u5728\u6b64\u90e8\u5206\u7684\u4e0d\u540c\u5185\u5bb9\u3002\u8fd9\u4e9b\u89c6\u89c9\u6807\u8bb0\u4e3a\uff1a&lt;&lt;&lt;&lt;&lt;&lt;&lt;,=======,&gt;&gt;&gt;&gt;&gt;&gt;&gt;\u3002\u8981\u627e\u5230\u51b2\u7a81\u53d1\u751f\u7684\u5177\u4f53\u4f4d\u7f6e\uff0c\u5728\u6587\u4ef6\u4e2d\u641c\u7d22\u8fd9\u4e9b\u89c6\u89c9\u6807\u8bb0\u4f1a\u975e\u5e38\u4fbf\u6377\u5730\u8fbe\u6210\u76ee\u7684\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">here is some content not affected by the conflict\n&lt;&lt;&lt;&lt;&lt;&lt;&lt; main\nthis is conflicted text from main\n=======\nthis is conflicted text from feature branch\n>>>>>>> feature branch;<\/pre>\n\n\n\n<p>\u901a\u5e38\u6765\u8bf4\u5728 ====== \u6807\u8bb0\u4e4b\u524d\u7684\u5185\u5bb9\u6765\u81ea\u4e8e\u63a5\u6536\u5408\u5e76\u7684\u5206\u652f\uff0c\u800c\u5728\u8fd9\u4e4b\u540e\u7684\u5185\u5bb9\u6765\u81ea\u4e8e\u8981\u5408\u5e76\u7684\u5206\u652f\u3002<\/p>\n\n\n\n<p>\u4e00\u65e6\u627e\u5230\u51b2\u7a81\u7684\u90e8\u5206\uff0c\u5c31\u53ef\u4ee5\u6839\u636e\u9700\u8981\u6765\u4fee\u6b63\u51b2\u7a81\u3002\u5f53\u4f60\u5b8c\u6210\u4e86\u51b2\u7a81\u7684\u4fee\u590d\u5e76\u51c6\u5907\u597d\u7ee7\u7eed\u8fdb\u884c\u5408\u5e76\uff0c\u53ea\u9700\u8981\u6267\u884c<code>git add<\/code>\u547d\u4ee4\u628a\u5df2\u7ecf\u89e3\u51b3\u597d\u51b2\u7a81\u7684\u6587\u4ef6\u6dfb\u52a0\u6682\u5b58\u533a\uff0c\u544a\u8bc9Git\u8fd9\u4e9b\u51b2\u7a81\u5df2\u7ecf\u89e3\u51b3\u5b8c\u6bd5\u5373\u53ef\u3002\u8fd9\u4e4b\u540e\u5c31\u50cf\u6b63\u5e38\u63d0\u4ea4\u4ee3\u7801\u4e00\u6837\u6267\u884c<code>git commit<\/code>\u5b8c\u6210\u5408\u5e76commit\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u8ddf\u6b63\u5e38\u60c5\u51b5\u4e0b\u63d0\u4ea4\u4ee3\u7801\u662f\u5b8c\u5168\u4e00\u6837\u7684\uff0c\u4e5f\u5c31\u662f\u8bf4\u5bf9\u4e8e\u666e\u901a\u5f00\u53d1\u8005\u6765\u8bf4\u5904\u7406\u51b2\u7a81\u4e5f\u662f\u5c0f\u83dc\u4e00\u789f\u3002<\/p>\n\n\n\n<p>\u8fd8\u9700\u6ce8\u610f\u5408\u5e76\u51b2\u7a81\u53ea\u53ef\u80fd\u51fa\u73b0\u5728\u4e09\u8def\u5408\u5e76\u8fc7\u7a0b\u4e2d\uff0c\u5728\u5feb\u8fdb\u5408\u5e76\u4e2d\u4e0d\u4f1a\u51fa\u73b0\u51b2\u7a81\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728Git\u4e2dmerge\u662f\u7528\u6765\u628a\u5206\u53c9\u7684\u63d0\u4ea4\u5386\u53f2\u653e\u56de\u5230\u4e00\u8d77\u7684\u65b9\u5f0f\u3002git merge\u547d\u4ee4\u7528\u6765\u5c06\u4f60\u4e4b\u524d\u4f7f\u7528git br [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/9802"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9802"}],"version-history":[{"count":6,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/9802\/revisions"}],"predecessor-version":[{"id":16770,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/9802\/revisions\/16770"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9802"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9802"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}