{"id":8714,"date":"2022-11-23T20:09:48","date_gmt":"2022-11-23T12:09:48","guid":{"rendered":"http:\/\/123.57.164.21\/?p=8714"},"modified":"2022-11-23T21:28:10","modified_gmt":"2022-11-23T13:28:10","slug":"git%e7%9a%84%e5%88%86%e6%94%af%e7%ae%a1%e7%90%86","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=8714","title":{"rendered":"Git\u7684\u5206\u652f\u5b9e\u8df5"},"content":{"rendered":"\n<p><strong>\u4e00 \u3001\u5206\u652f\u4ecb\u7ecd<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u5982\u679c\u628aGit\u6bd4\u55bb\u4e3a\u4e00\u6761\u5c0f\u6cb3\uff0cmaster\u5206\u652f\u662f\u5c0f\u6cb3\u7684\u4e3b\u5e72\/\u4e3b\u5206\u652f\uff0c\u5176\u4ed6\u5206\u652f\u5c31\u662f\u8fd9\u6761\u5c0f\u6cb3\u7684\u652f\u6d41\uff0c\u53ef\u4ee5\u628a\u6240\u6709\u5206\u652f\u5408\u5e76\u5230\u4e00\u8d77\u5f62\u6210\u4e00\u6761\u5927\u6cb3\uff0c\u6eda\u6eda\u5954\u5411\u5927\u6d77&#8230;&#8230;<\/p>\n\n\n\n<p>\u200bGit\u672c\u8d28\u4e0a\u53ea\u662f\u4e00\u68f5\u5de8\u5927\u7684\u6587\u4ef6\u6811\uff0c\u5206\u652f\u6307\u7684\u662f\u6811\u7684\u4e00\u4e2a\u5206\u53c9\uff0c\u6211\u4eec\u53ef\u4ee5\u5bf9\u5206\u652f\u8fdb\u884c\u5408\u5e76\u3002<\/p>\n\n\n\n<p>\u200b\u90a3\u4e48\u5206\u652f\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\u6709\u4ec0\u4e48\u7528\u5904\u5462\uff1f<\/p>\n\n\n\n<p>\u200b\u5982\u679c\u4f60\u51c6\u5907\u5f00\u53d1\u4e00\u4e2a\u65b0\u529f\u80fd\uff0c\u9700\u8981\u4e24\u5468\u624d\u80fd\u5b8c\u6210\uff0c\u7b2c\u4e00\u5468\u4f60\u5199\u4e8650%\u7684\u4ee3\u7801\uff0c\u6b64\u65f6\u5982\u679c\u7acb\u523b\u63d0\u4ea4\uff0c\u7531\u4e8e\u4ee3\u7801\u8fd8\u6ca1\u5199\u5b8c\uff0c\u800c\u4e0d\u5b8c\u6574\u7684\u4ee3\u7801\u5e93\u4f1a\u5bfc\u81f4\u522b\u4eba\u4e0d\u80fd\u5e72\u6d3b\u4e86\u3002\u4f46\u5982\u679c\u7b49\u4ee3\u7801\u5168\u90e8\u5199\u5b8c\u518d\u4e00\u6b21\u63d0\u4ea4\uff0c\u53c8\u5b58\u5728\u4e22\u5931\u6bcf\u5929\u8fdb\u5ea6\u7684\u5de8\u5927\u98ce\u9669\u3002<\/p>\n\n\n\n<p>\u200b\u73b0\u5728\u6709\u4e86\u5206\u652f\uff0c\u5c31\u4e0d\u7528\u6015\u4e86\u3002\u4f60\u521b\u5efa\u4e86\u4e00\u4e2a\u5c5e\u4e8e\u4f60\u81ea\u5df1\u7684\u5206\u652f\uff0c\u522b\u4eba\u770b\u4e0d\u5230\uff0c\u8fd8\u7ee7\u7eed\u5728\u539f\u6765\u7684\u5206\u652f\u4e0a\u6b63\u5e38\u5de5\u4f5c\uff0c\u800c\u4f60\u5728\u81ea\u5df1\u7684\u5206\u652f\u4e0a\u5e72\u6d3b\uff0c\u60f3\u63d0\u4ea4\u5c31\u63d0\u4ea4\uff0c\u76f4\u5230\u5f00\u53d1\u5b8c\u6bd5\u540e\uff0c\u518d\u4e00\u6b21\u6027\u5408\u5e76\u5230\u539f\u6765\u7684\u5206\u652f\u4e0a\uff0c\u8fd9\u6837\uff0c\u65e2\u5b89\u5168\uff0c\u53c8\u4e0d\u5f71\u54cd\u522b\u4eba\u5de5\u4f5c\u3002<\/p>\n\n\n\n<p>\u200b\u5206\u652f\u662fGit\u7684\u6740\u624b\u7ea7\u7279\u5f81\uff0c\u800c\u4e14Git\u9f13\u52b1\u5728\u5de5\u4f5c\u6d41\u7a0b\u4e2d\u9891\u7e41\u4f7f\u7528\u5206\u652f\u4e0e\u5408\u5e76\uff0c\u54ea\u6015\u4e00\u5929\u4e4b\u5185\u8fdb\u884c\u8bb8\u591a\u6b21\u90fd\u6ca1\u6709\u5173\u7cfb\u3002\u56e0\u4e3aGit\u5206\u652f\u975e\u5e38\u8f7b\u91cf\u7ea7\uff0c\u4e0d\u50cf\u5176\u4ed6\u7684\u7248\u672c\u63a7\u5236\uff0c\u521b\u5efa\u5206\u652f\u610f\u5473\u7740\u8981\u628a\u9879\u76ee\u5b8c\u6574\u7684\u62f7\u8d1d\u4e00\u4efd\uff0c\u800cGit\u521b\u5efa\u5206\u652f\u662f\u5728\u77ac\u95f4\u5b8c\u6210\u7684\uff0c\u800c\u4e0e\u4f60\u5de5\u7a0b\u7684\u590d\u6742\u7a0b\u5ea6\u65e0\u5173\u3002<\/p>\n\n\n\n<p><strong>\u4e8c\u3001\u521b\u5efa\u5206\u652f\u4e0e\u5408\u5e76\u5206\u652f<\/strong><\/p>\n\n\n\n<p>\u200b\u5206\u652f\u53ef\u4ee5\u88ab\u7406\u89e3\u4e3a\u4e00\u6761\u65f6\u95f4\u7ebf\uff0c\u8fd9\u4e00\u6761\u65f6\u95f4\u7ebf\u4e0a\u4e32\u7740\u4e00\u4e2a\u4e2a\u8282\u70b9\uff0c\u6bcf\u4e2a\u8282\u70b9\u90fd\u662f\u4e00\u6b21\u63d0\u4ea4\u8bb0\u5f55\/\u7248\u672c\u3002<\/p>\n\n\n\n<p>\u200bgit\u9ed8\u8ba4\u53ea\u6709\u4e00\u6761\u65f6\u95f4\u7ebfor\u5206\u652f\uff0c\u8be5\u65f6\u95f4\u7ebfor\u5206\u652f\u79f0\u4e4b\u4e3a\u4e3b\u5206\u652f\uff0c\u5373master\u5206\u652f\uff0c\u6587\u4ef6.git\/refs\/heads\/master \u5185\u5b58\u653e\u7740\u6307\u5411master\u5206\u652f\u6700\u65b0\u7248\u672c\u7684\u6307\u9488\uff0c\u5982\u679c\u4e0b\u6240\u793a\u7ea2\u8272\u5757\u5373master\u6307\u9488\uff0c\u6307\u5411master\u5206\u652f<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-275.png\" alt=\"\" class=\"wp-image-8716\" width=\"399\" height=\"150\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-275.png 684w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-275-300x112.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-275-230x86.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-275-350x131.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-275-480x180.png 480w\" sizes=\"(max-width: 399px) 100vw, 399px\" \/><figcaption><code># \u6ce8\u610f\u7bad\u5934\u65b9\u5411\uff0c\u56e0\u4e3a\u6bcf\u4e00\u6b21\u63d0\u4ea4\u90fd\u6709\u4e00\u4e2a\u6307\u5411\u4e0a\u4e00\u6b21\u63d0\u4ea4\u7684\u6307\u9488\uff0c\u6240\u4ee5\u7bad\u5934\u65b9\u5411\u5411\u5de6\uff0c\u66f4\u4e3a\u5408\u7406<\/code><\/figcaption><\/figure><\/div>\n\n\n\n<p>\u6bcf\u6b21\u63d0\u4ea4\uff0c<code>master<\/code>\u5206\u652f\u90fd\u4f1a\u5411\u524d\u79fb\u52a8\u4e00\u6b65\uff0cmaster\u6307\u9488\u6307\u5411\u6700\u65b0\u63d0\u4ea4\u7684\u4e00\u4e2a\u7248\u672c\uff0c\u8fd9\u6837\uff0c\u968f\u7740\u4f60\u4e0d\u65ad\u63d0\u4ea4\uff0c<code>master<\/code>\u5206\u652f\u7684\u7ebf\u4e5f\u8d8a\u6765\u8d8a\u957f\uff0c\u5982\u4e0b<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-276-1024x623.png\" alt=\"\" class=\"wp-image-8717\" width=\"552\" height=\"336\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-276-1024x623.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-276-300x182.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-276-768x467.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-276-830x505.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-276-230x140.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-276-350x213.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-276-480x292.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-276.png 1118w\" sizes=\"(max-width: 552px) 100vw, 552px\" \/><\/figure><\/div>\n\n\n\n<p>\u5982\u679c\u6211\u4eec\u6709\u591a\u4e2a\u5206\u652f\uff0c\u90a3\u4e48GIT\u5982\u4f55\u5b9e\u73b0\u5728\u591a\u4e2a\u5206\u652f\u4e4b\u95f4\u6765\u56de\u5207\u6362\u7684\u5462\uff0c<code>.git<\/code>\u6587\u4ef6\u5939\u4e0b\u7684<code>HEAD<\/code>\u6587\u4ef6\u8d1f\u8d23\u5b58\u653e\u5f53\u524d\u6240\u5728\u7684\u5206\u652f<code>ref: refs\/heads\/&lt;\u5206\u652f\u540d\u79f0&gt;<\/code>\uff0c\u5207\u6362\u5206\u652f\u5c31\u662f\u4fee\u6539HEAD\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9\u4e3a\u5bf9\u5e94\u5206\u652f\uff0c\u5e76\u5c06\u5de5\u4f5c\u533a\u7684\u6587\u4ef6\u6062\u590d\u81f3\u5bf9\u5e94\u5206\u652f\u7684\u5185\u5bb9\uff0c\u6240\u4ee5\u4e25\u683c\u6765\u8bf4<code>HEAD<\/code>\u4e0d\u662f\u6307\u5411\u63d0\u4ea4\uff0c\u800c\u662f\u6307\u5411\u5f53\u524d\u6240\u5728\u7684\u5206\u652f\uff0c\u6bd4\u5982master\uff0c<code>master<\/code>\u624d\u662f\u6307\u5411\u63d0\u4ea4\u7684\uff0c\u4e00\u5f00\u59cb\u7684\u65f6\u5019\uff0c<code>master<\/code>\u5206\u652f\u662f\u4e00\u6761\u7ebf\uff0cGit\u7528<code>master<\/code>\u6307\u5411\u6700\u65b0\u7684\u63d0\u4ea4\uff0c\u518d\u7528<code>HEAD<\/code>\u6307\u5411<code>master<\/code>\uff0c\u5c31\u80fd\u786e\u5b9a\u5f53\u524d\u5206\u652f\uff0c\u4ee5\u53ca\u5f53\u524d\u5206\u652f\u7684\u63d0\u4ea4\u70b9\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-277.png\" alt=\"\" class=\"wp-image-8718\" width=\"512\" height=\"192\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-277.png 920w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-277-300x112.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-277-768x287.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-277-830x310.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-277-230x86.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-277-350x131.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-277-480x179.png 480w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/figure><\/div>\n\n\n\n<p>\u5f53\u6211\u4eec\u521b\u5efa\u5e76\u5207\u6362\u5230\u4e00\u4e2a\u65b0\u7684\u5206\u652f\uff0c\u4f8b\u5982<code>dev<\/code>\u65f6<\/p>\n\n\n\n<ul><li>1 \u3001Git\u4f1a\u65b0\u5efa\u4e00\u4e2a\u6307\u9488\u53eb<code>dev<\/code>\uff0c\u6307\u5411<code>master<\/code>\u76f8\u540c\u7684\u63d0\u4ea4<\/li><li>2\u3001\u7136\u540e\u518d\u628a<code>HEAD<\/code>\u6307\u5411<code>dev<\/code>\uff0c\u5c31\u8868\u793a\u5f53\u524d\u5206\u652f\u5728<code>dev<\/code>\u4e0a<\/li><li>ps\uff1aGit\u521b\u5efa\u4e00\u4e2a\u5206\u652f\u5f88\u5feb\uff0c\u56e0\u4e3a\u9664\u4e86\u589e\u52a0\u4e00\u4e2a<code>dev<\/code>\u6307\u9488\uff0c\u6539\u6539<code>HEAD<\/code>\u7684\u6307\u5411\uff0c\u5de5\u4f5c\u533a\u7684\u6587\u4ef6\u90fd\u6ca1\u6709\u4efb\u4f55\u53d8\u5316\uff01<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-278.png\" alt=\"\" class=\"wp-image-8719\" width=\"514\" height=\"264\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-278.png 950w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-278-300x154.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-278-768x395.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-278-830x426.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-278-230x118.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-278-350x180.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-278-480x247.png 480w\" sizes=\"(max-width: 514px) 100vw, 514px\" \/><\/figure><\/div>\n\n\n\n<p>\u5982\u679cHEAD\u6307\u5411dev\uff0c\u90a3\u4e48\u4ee3\u8868\u5f53\u524d\u5206\u652f\u5728dev\u4e0a\uff0c\u8fd9\u610f\u5473\u7740\u63a5\u4e0b\u6765\u5bf9\u5de5\u4f5c\u7684\u4fee\u6539\u548c\u63d0\u4ea4\u90fd\u662f\u9488\u5bf9dev\u5206\u652f\u4e86\uff0c\u5982\u679cmaster\u662f\u5c0f\u6cb3\u7684\u4e3b\u5e72\uff0c\u90a3\u4e48dev\u5c31\u662f\u8fd9\u6761\u6cb3\u7684\u652f\u6d41\uff0c\u4e3b\u5e72\u7684\u6c34\u88ab\u5f15\u5165\u4e86\u652f\u6d41.<\/p>\n\n\n\n<p>\u6bd4\u5982\u63d0\u4ea4\u4e00\u6b21\u540e\uff0cdev\u6307\u9488\u5f80\u540e\u79fb\u52a8\u4e00\u6b65\uff0c\u800cmaster\u6307\u9488\u4e0d\u53d8<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-279-1024x475.png\" alt=\"\" class=\"wp-image-8720\" width=\"507\" height=\"235\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-279-1024x475.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-279-300x139.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-279-768x356.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-279-830x385.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-279-230x107.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-279-350x162.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-279-480x223.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-279.png 1116w\" sizes=\"(max-width: 507px) 100vw, 507px\" \/><\/figure><\/div>\n\n\n\n<p>\u5f53\u5728<code>master<\/code>\u5206\u652f\u5408\u5e76<code>dev<\/code>\u5206\u652f\u65f6\uff0c\u56e0\u4e3a\u4ed6\u4eec\u5728\u4e00\u6761\u7ebf\u4e0a\uff0c\u8fd9\u79cd\u5355\u7ebf\u7684\u5386\u53f2\u5206\u652f\u4e0d\u5b58\u5728\u4efb\u4f55\u9700\u8981\u89e3\u51b3\u7684\u5206\u6b67\uff0c\u6240\u4ee5\u53ea\u9700\u8981<code>master<\/code>\u6307\u9488\u6307\u5411<code>dev<\/code>\u5206\u652f\u7684\u6700\u65b0\u4e00\u6b21\u63d0\u4ea4\u5373\u53ef\uff0c\u6240\u4ee5\u975e\u5e38\u5feb\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-280.png\" alt=\"\" class=\"wp-image-8721\" width=\"489\" height=\"239\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-280.png 994w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-280-300x146.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-280-768x374.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-280-830x404.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-280-230x112.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-280-350x170.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-280-480x234.png 480w\" sizes=\"(max-width: 489px) 100vw, 489px\" \/><\/figure><\/div>\n\n\n\n<p>\u6240\u4ee5\u4f60\u770b\uff0cgit\u4e0d\u4ec5\u521b\u5efa\u5206\u652f\u5feb\uff0c\u5408\u5e76\u5206\u652f\u4e5f\u5f88\u5feb\uff01\u5c31\u6539\u6539\u6307\u9488\uff0c\u5de5\u4f5c\u533a\u5185\u5bb9\u4e5f\u4e0d\u53d8\uff01<\/p>\n\n\n\n<p>\u5408\u5e76\u5b8c\u5206\u652f\u540e\uff0c\u751a\u81f3\u53ef\u4ee5\u5220\u9664<code>dev<\/code>\u5206\u652f\u3002\u5220\u9664<code>dev<\/code>\u5206\u652f\u5c31\u662f\u628a<code>dev<\/code>\u6307\u9488\u7ed9\u5220\u6389\uff0c\u5220\u6389\u540e\uff0c\u6211\u4eec\u5c31\u5269\u4e0b\u4e86\u4e00\u6761<code>master<\/code>\u5206\u652f\uff0c\u751a\u81f3\u90fd\u770b\u4e0d\u51fa\u6765\u6dfb\u52a0\u8fc7dev\u5206\u652f\uff0c\u6bc1\u5c38\u706d\u8ff9\u4e86<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-281-1024x520.png\" alt=\"\" class=\"wp-image-8722\" width=\"497\" height=\"252\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-281-1024x520.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-281-300x152.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-281-768x390.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-281-830x422.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-281-230x117.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-281-350x178.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-281-480x244.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-281.png 1106w\" sizes=\"(max-width: 497px) 100vw, 497px\" \/><\/figure><\/div>\n\n\n\n<p><strong>\u5b9e\u64cd<\/strong><\/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=\"\">1\u3001\u5728\u5f53\u524d\u5206\u652f\u4e0b\u521b\u5efa\u5b50\u5206\u652f\u5e76\u5207\u6362\n-----------------------------------------------------------------------------\n# 1.1 \u521b\u5efa+\u5207\u6362=>\u4e24\u6761\u547d\u4ee4\u641e\u5b9a\ngit branch dev # \u5728\u5f53\u524d\u5206\u652f\u4e0b\u521b\u5efa\u5b50\u5206\u652f\ngit checkout dev # \u7531\u5f53\u524d\u5206\u652f\u5207\u6362\u5230\u5b50\u5206\u652f\n\n#1.2 \u521b\u5efa+\u5207\u6362=>\u4e00\u6761\u547d\u4ee4\u641e\u5b9a\ngit checkout -b dev # \u7b49\u540c\u4e8e\u4e0a\u8ff0\u4e24\u6761\u547d\u4ee4\uff0c\u4ee3\u8868\u521b\u5efa\u5e76\u5207\u6362\u5230\u5b50\u5206\u652f\n\n2\u3001\u76f4\u63a5\u5207\u6362\u5230\u5df2\u6709\u5206\u652f\n-----------------------------------------------------------------------------\ngit checkout dev\n\n3\u3001\u67e5\u770b\u5f53\u524d\u5206\u652f\n-----------------------------------------------------------------------------\n$ git branch # \u8be5\u547d\u4ee4\u4f1a\u5217\u51fa\u6240\u6709\u5206\u652f\uff0c\u5f53\u524d\u6240\u5728\u5206\u652f\u524d\u4f1a\u6807\u4e00\u4e2a*\u53f7\u3002\n* dev\nmaster\n\n4\u3001\u5207\u6362\u5230dev\u5206\u652f\u4e0b\u4fee\u6539\u5e76\u63d0\u4ea4\u8bb0\u5f55\/\u7248\u672c\n-----------------------------------------------------------------------------\ngit checkout dev\necho \"111\" > c.txt\ngit add .\ngit commit -m \"v4\"\n\ngit checkout master\ngit merge dev # git merge\u547d\u4ee4\u7528\u4e8e\u5408\u5e76\u6307\u5b9a\u5206\u652f\u5230\u5f53\u524d\u5206\u652f\u3002\n\n\u5982\u679c\u987a\u7740\u4e00\u4e2a\u5206\u652f\u8d70\u4e0b\u53bb\u53ef\u4ee5\u5230\u8fbe\u53e6\u4e00\u4e2a\u5206\u652f\u7684\u8bdd\uff0c\u90a3\u4e48 Git \u5728\u5408\u5e76\u4e24\u8005\u65f6\uff0c\u53ea\u4f1a\u7b80\u5355\u5730\u628a\u6307\u9488\u53f3\u79fb\uff0c\u56e0\u4e3a\u8fd9\u79cd\u5355\u7ebf\u7684\u5386\u53f2\u5206\u652f\u4e0d\u5b58\u5728\u4efb\u4f55\u9700\u8981\u89e3\u51b3\u7684\u5206\u6b67\uff0c\u6240\u4ee5\u8fd9\u79cd\u5408\u5e76\u8fc7\u7a0b\u53ef\u4ee5\u79f0\u4e3a\u5feb\u8fdb\uff08Fast forward\uff09\uff0c\u4e0a\u8ff0\u5408\u5e76git merge dev\u7528\u7684\u5c31\u662fFast-forward\u5feb\u8fdb\u6a21\u5f0f\uff0c\u6beb\u65e0\u7591\u95ee\u4e0d\u662f\u6bcf\u6b21\u5408\u5e76\u90fd\u80fd\u91c7\u7528Fast-forward\uff0c\u6211\u4eec\u5c06\u5728\u7b2c\u56db\u5c0f\u8282\u4ecb\u7ecd\u3002\n\u5408\u5e76\u5b8c\u6210\u540e\uff0c\u5c31\u53ef\u4ee5\u653e\u5fc3\u5730\u5220\u9664dev\u5206\u652f\u4e86\n$ git branch -d dev\nDeleted branch dev (was f1d9621).\n\n$ git branch\n* master\n\n\u56e0\u4e3a\u521b\u5efa\u3001\u5408\u5e76\u548c\u5220\u9664\u5206\u652f\u975e\u5e38\u5feb\uff0c\u6240\u4ee5Git\u9f13\u52b1\u4f60\u4f7f\u7528\u5206\u652f\u5b8c\u6210\u67d0\u4e2a\u4efb\u52a1\uff0c\u5408\u5e76\u540e\u518d\u5220\u6389\u5206\u652f\uff0c\u8fd9\u548c\u76f4\u63a5\u5728master\u5206\u652f\u4e0a\u5de5\u4f5c\u6548\u679c\u662f\u4e00\u6837\u7684\uff0c\u4f46\u8fc7\u7a0b\u66f4\u5b89\u5168\u3002\n\n5\u3001switch\n-----------------------------------------------------------------------------\n\u56e0\u4e3aget checkout -- &lt;file>\u6587\u4ef6\u901a\u5e38\u662f\u7528\u6765\u64a4\u9500\u4fee\u6539\u7684\uff0c\u53c8\u7528\u5b83\u6765\u521b\u5efa\u5e76\u5207\u6362\u5206\u652f\uff0c\u6709\u70b9\u5bb9\u6613\u8ba9\u4eba\u6df7\u6dc6\uff0c\u6240\u4ee5\n\u6700\u65b0\u7248\u672c\u7684Git\u63d0\u4f9b\u4e86\u65b0\u7684git switch\u547d\u4ee4\u6765\u521b\u5efaor\u5207\u6362\u5206\u652f\uff0c\u63a8\u8350\u4f7f\u7528\n$ git switch -c dev # \u521b\u5efa\u5e76\u5207\u6362\u5230\u65b0\u7684dev\u5206\u652f\uff0c\u7b49\u540c\u4e8egit checkout -b dev\n$ git switch master # \u76f4\u63a5\u5207\u6362\u5230\u5df2\u6709\u7684master\u5206\u652f<\/pre>\n\n\n\n<p><strong>\u4e09\u3001\u5206\u652f\u7ba1\u7406\u7b56\u7565<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>Fast-forward\u5feb\u8fdb\u6a21\u5f0f\u4e0b\u5408\u5e76\u7684\u7ed3\u679c\u5982\u4e0b\u56fe\u6240\u793a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-282-1024x530.png\" alt=\"\" class=\"wp-image-8724\" width=\"470\" height=\"242\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-282-1024x530.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-282-300x155.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-282-830x430.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-282-230x119.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-282-350x181.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-282-480x248.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-282.png 1078w\" sizes=\"(max-width: 470px) 100vw, 470px\" \/><\/figure><\/div>\n\n\n\n<p>\u8be5\u6a21\u5f0f\u4e0b\uff0c\u5220\u9664\u5206\u652fdev\u540e\uff0c\u67e5\u770b\u7248\u672c\u65e5\u5fd7\u6839\u672c\u770b\u4e0d\u5230\u505a\u8fc7\u5408\u5e76<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">git branch -d dev<\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-283-1024x381.png\" alt=\"\" class=\"wp-image-8725\" width=\"479\" height=\"178\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-283-1024x381.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-283-300x112.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-283-768x286.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-283-830x309.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-283-230x86.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-283-350x130.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-283-480x178.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-283.png 1092w\" sizes=\"(max-width: 479px) 100vw, 479px\" \/><\/figure><\/div>\n\n\n\n<p>\u5982\u679c\u60f3\u5728\u5220\u6389\u5206\u652f\u540e\uff0c\u4e5f\u80fd\u5728\u7248\u672c\u65e5\u5fd7\u91cc\u770b\u5230\u505a\u8fc7\u5408\u5e76\u64cd\u4f5c\uff0c\u9700\u8981\u5728git merge\u65f6\u5f3a\u5236\u7981\u7528<code>Fast forward<\/code>\u6a21\u5f0f\uff0c\u5e76\u4e14\u63d0\u4ea4\u4e00\u4e2a\u7684\u7248\u672c<\/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 checkout -b dev\n$ echo \"haha\" > readme.txt\n$ git add .\n$ git commit -m \"v5\"\n$ git checkout master\n$ git  merge --no-ff -m \"no-ff\u5408\u5e76\u7248\" dev  # --no-ff\u53c2\u6570\uff0c\u8868\u793a\u7981\u7528Fast forward\uff1b\u56e0\u4e3a\u672c\u6b21\u5408\u5e76\u8981\u521b\u5efa\u4e00\u4e2a\u65b0\u7684commit\uff0c\u6240\u4ee5\u52a0\u4e0a-m\u53c2\u6570\uff0c\u628acommit\u63cf\u8ff0\u5199\u8fdb\u53bb\u3002\n\n\n$ git log --graph --pretty=oneline --abbrev-commit\n*   40656a7 (HEAD -> master) no-ff\u5408\u5e76\u7248\n|\\  \n| * 1d0a989 (dev) v5\n|\/  \n* a918dfc v5\n* f1d9621 v4\n* 3522291 v3\n* b27998a v2\n* 8519849 v1\n* 34fe61e v0<\/pre>\n\n\n\n<p>\u5982\u679cmerge\u65f6\u4f7f\u7528<code>Fast forward<\/code>\u6a21\u5f0f<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-284-1024x440.png\" alt=\"\" class=\"wp-image-8726\" width=\"466\" height=\"199\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-284-1024x440.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-284-300x129.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-284-768x330.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-284-830x357.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-284-230x99.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-284-350x150.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-284-480x206.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-284.png 1112w\" sizes=\"(max-width: 466px) 100vw, 466px\" \/><\/figure><\/div>\n\n\n\n<p>\u5982\u679cmere\u65f6\u7981\u7528<code>Fast forward<\/code>\u6a21\u5f0f\uff0c\u4f1a\u63d0\u4ea4\u4e00\u4e2a\u65b0\u7684\u7248\u672c<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-285-1024x415.png\" alt=\"\" class=\"wp-image-8727\" width=\"474\" height=\"192\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-285-1024x415.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-285-300x122.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-285-768x311.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-285-830x336.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-285-230x93.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-285-350x142.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-285-480x195.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-285.png 1120w\" sizes=\"(max-width: 474px) 100vw, 474px\" \/><\/figure><\/div>\n\n\n\n<p>\u5220\u9664\u5206\u652fdev\u540e\u67e5\u770b<\/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 branch -d dev # \u5220\u6389\u5206\u652fdev\uff0c\u4ecd\u7136\u53ef\u4ee5\u770b\u5230\u5408\u5e76\u4fe1\u606f\n\n$ git log --graph --pretty=oneline --abbrev-commit\n*   40656a7 (HEAD -> master) no-ff\u5408\u5e76\u7248\n|\\  \n| * 1d0a989 v5\n|\/  \n* a918dfc v5\n* f1d9621 v4\n* 3522291 v3\n* b27998a v2\n* 8519849 v1\n* 34fe61e v0<\/pre>\n\n\n\n<p><strong>\u5206\u652f\u7b56\u7565<\/strong><\/p>\n\n\n\n<p>\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u6211\u4eec\u5e94\u8be5\u6309\u7167\u51e0\u4e2a\u57fa\u672c\u539f\u5219\u8fdb\u884c\u5206\u652f\u7ba1\u7406\uff1a<\/p>\n\n\n\n<p>\u9996\u5148\uff0c<code>master<\/code>\u5206\u652f\u5e94\u8be5\u662f\u975e\u5e38\u7a33\u5b9a\u7684\uff0c\u4e5f\u5c31\u662f\u4ec5\u7528\u6765\u53d1\u5e03\u65b0\u7248\u672c\uff0c\u5e73\u65f6\u4e0d\u80fd\u5728\u4e0a\u9762\u5e72\u6d3b\uff1b<\/p>\n\n\n\n<p>\u90a3\u5728\u54ea\u5e72\u6d3b\u5462\uff1f\u5e72\u6d3b\u90fd\u5728<code>dev<\/code>\u5206\u652f\u4e0a\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c<code>dev<\/code>\u5206\u652f\u662f\u4e0d\u7a33\u5b9a\u7684\uff0c\u5230\u67d0\u4e2a\u65f6\u5019\uff0c\u6bd4\u59821.0\u7248\u672c\u53d1\u5e03\u65f6\uff0c\u518d\u628a<code>dev<\/code>\u5206\u652f\u5408\u5e76\u5230<code>master<\/code>\u4e0a\uff0c\u5728<code>master<\/code>\u5206\u652f\u53d1\u5e031.0\u7248\u672c\uff1b<\/p>\n\n\n\n<p>\u4f60\u548c\u4f60\u7684\u5c0f\u4f19\u4f34\u4eec\u6bcf\u4e2a\u4eba\u90fd\u5728<code>dev<\/code>\u5206\u652f\u4e0a\u5e72\u6d3b\uff0c\u6bcf\u4e2a\u4eba\u90fd\u6709\u81ea\u5df1\u7684\u5206\u652f\uff0c\u65f6\u4e0d\u65f6\u5730\u5f80<code>dev<\/code>\u5206\u652f\u4e0a\u5408\u5e76\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5\uff0c\u56e2\u961f\u5408\u4f5c\u7684\u5206\u652f\u770b\u8d77\u6765\u5c31\u50cf\u8fd9\u6837\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-286.png\" alt=\"\" class=\"wp-image-8729\" width=\"573\" height=\"170\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-286.png 864w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-286-300x90.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-286-768x229.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-286-830x248.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-286-230x69.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-286-350x105.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-286-480x143.png 480w\" sizes=\"(max-width: 573px) 100vw, 573px\" \/><\/figure><\/div>\n\n\n\n<p><strong>\u5c0f\u7ed3<\/strong><\/p>\n\n\n\n<p>Git\u5206\u652f\u5341\u5206\u5f3a\u5927\uff0c\u5728\u56e2\u961f\u5f00\u53d1\u4e2d\u5e94\u8be5\u5145\u5206\u5e94\u7528\u3002<\/p>\n\n\n\n<p>\u5408\u5e76\u5206\u652f\u65f6\uff0c\u52a0\u4e0a<code>--no-ff<\/code>\u53c2\u6570\u5c31\u53ef\u4ee5\u7528\u666e\u901a\u6a21\u5f0f\u5408\u5e76\uff0c\u5408\u5e76\u540e\u7684\u5386\u53f2\u6709\u5206\u652f\uff0c\u80fd\u770b\u51fa\u6765\u66fe\u7ecf\u505a\u8fc7\u5408\u5e76\uff0c\u800c<code>fast forward<\/code>\u5408\u5e76\u5c31\u770b\u4e0d\u51fa\u6765\u66fe\u7ecf\u505a\u8fc7\u5408\u5e76\u3002<\/p>\n\n\n\n<p><strong>\u56db \u89e3\u51b3\u51b2\u7a81<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u627f\u63a5\u7b2c\u4e8c\u5c0f\u8282\uff1a\u5982\u679c\u987a\u7740\u4e00\u4e2a\u5206\u652f\u8d70\u4e0b\u53bb\u53ef\u4ee5\u5230\u8fbe\u53e6\u4e00\u4e2a\u5206\u652f\uff0c\u4e2d\u95f4\u65e0\u5206\u53c9\u7684\u8bdd\uff0c\u90a3\u4e48 Git \u5728\u5408\u5e76\u4e24\u8005\u65f6\uff0c\u53ea\u4f1a\u7b80\u5355\u5730\u628a\u6307\u9488\u53f3\u79fb\uff0c\u56e0\u4e3a\u8fd9\u79cd\u5355\u7ebf\u7684\u5386\u53f2\u5206\u652f\u4e0d\u5b58\u5728\u4efb\u4f55\u9700\u8981\u89e3\u51b3\u7684\u5206\u6b67\uff0c\u6240\u4ee5\u8fd9\u79cd\u5408\u5e76\u8fc7\u7a0b\u53ef\u4ee5\u79f0\u4e3a\u5feb\u8fdb\uff08Fast forward\uff09<\/p>\n\n\n\n<p>\u4f46\u5982\u679c\u5408\u5e76\u7248\u672c\u65f6\u6709\u51b2\u7a81\u95ee\u9898\uff0c\u4fbf\u4e0d\u53ef\u7528\u5feb\u8fdb\u6a21\u5f0f\uff0c\u5f53\u5206\u652f\u51fa\u73b0\u5206\u53c9\u65f6\uff0c\u5c31\u6709\u53ef\u80fd\u51fa\u73b0\u51b2\u7a81\uff0c\u800c\u8fd9\u65f6Git\u5c31\u4f1a\u8981\u6c42\u4f60\u53bb\u89e3\u51b3\u51b2\u7a81\uff0c\u6bd4\u5982\u50cf\u4e0b\u9762\u7684\u5386\u53f2<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-287-1024x595.png\" alt=\"\" class=\"wp-image-8730\" width=\"406\" height=\"235\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-287-1024x595.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-287-300x174.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-287-768x446.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-287-830x482.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-287-230x134.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-287-350x203.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-287-480x279.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-287.png 1102w\" sizes=\"(max-width: 406px) 100vw, 406px\" \/><\/figure><\/div>\n\n\n\n<p>\u5206\u652f\u548c<code>dev<\/code>\u5206\u652f\u4e0d\u5728\u4e00\u6761\u7ebf\u4e0a\uff0c\u5373<code>v7<\/code>\u4e0d\u662f<code>v5<\/code>\u7684\u76f4\u63a5\u7956\u5148\uff0cGit \u4e0d\u5f97\u4e0d\u8fdb\u884c\u4e00\u4e9b\u989d\u5916\u5904\u7406\u3002\u5c31\u6b64\u4f8b\u800c\u8a00\uff0cGit \u4f1a\u7528\u4e24\u4e2a\u5206\u652f\u7684\u672b\u7aef\uff08<code>v7<\/code> \u548c <code>v5<\/code>\uff09\u4ee5\u53ca\u5b83\u4eec\u7684\u5171\u540c\u7956\u5148\uff08<code>v3<\/code>\uff09\u8fdb\u884c\u4e00\u6b21\u7b80\u5355\u7684\u4e09\u65b9\u5408\u5e76\u8ba1\u7b97\u3002\u5408\u5e76\u4e4b\u540e\u4f1a\u751f\u6210\u4e00\u4e2a\u548c\u5e76\u63d0\u4ea4<code>v8<\/code>\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-288-1024x489.png\" alt=\"\" class=\"wp-image-8731\" width=\"501\" height=\"239\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-288-1024x489.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-288-300x143.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-288-768x367.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-288-830x396.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-288-230x110.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-288-350x167.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-288-480x229.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2022\/11\/\u56fe\u7247-288.png 1118w\" sizes=\"(max-width: 501px) 100vw, 501px\" \/><\/figure><\/div>\n\n\n\n<p>\u6ce8\u610f\uff1a\u5408\u5e76\u63d0\u4ea4\u6709\u4e24\u4e2a\u7956\u5148\uff08<code>v7<\/code>\u548c<code>v5<\/code>\uff09\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=\"\">#1\u3001\u5728\u4e3b\u5206\u652f\u4e0a\u8fde\u7eed\u63d0\u4ea4\u4e864\u4e2a\u7248\u672c\n---------------------------------------------------------\ngit init \ngit config --local user.name 'egon'\ngit config --local user.email 'egon@example.com'\n\necho \"hello egon\" > a.txt\ngit add .\ngit commit -m \"v0\"\n\necho \"bbb\" > b.txt\ngit add .\ngit commit -m \"v1\"\n\necho \"ccc\" > c.txt\ngit add .\ngit commit -m \"v2\"\n\necho \"ddd\" > d.txt\ngit add .\ngit commit -m \"v3\"\n\n#2\u3001\u5207\u6362\u5230dev\u5206\u652f\u4e0a\u4fee\u6539a.txt\u7684\u5185\u5bb9\u5e76\u63d0\u4ea41\u4e2a\u7248\u672c\n---------------------------------------------------------\ngit checkout -b dev\nvim a.txt # \u6539\u6210hello sb\ngit add .\ngit commit -m \"v4\"\n\n#3\u3001\u5207\u56demaster\u5206\u652f\u4e0a\u4fee\u6539a.txt\u7684\u5185\u5bb9\u5e76\u63d0\u4ea41\u4e2a\u7248\u672c\uff0c\u6ce8\u610f\u6b64\u65f6\u4fee\u6539\u7684a.txt\u4e0e2\u4e2d\u4fee\u6539\u7684\u53d1\u751f\u4e86\u51b2\u7a81\n---------------------------------------------------------\ngit checkout master\nvim a.txt # \u6539\u6210hi bigsb\ngit add .\ngit commit -m \"v5\"\n\n#4\u3001\u5728\u4e3b\u5206\u652f\u4e0a\u5408\u5e76dev\u5206\u652f\uff0c\u62a5\u9519\uff1a\u51b2\u7a81\n---------------------------------------------------------\n$ git merge dev \nAuto-merging a.txt\nCONFLICT (content): Merge conflict in a.txt\nAutomatic merge failed; fix conflicts and then commit the result.\n\n#5\u3001\u9700\u8981\u624b\u52a8\u89e3\u51b3\u51b2\u7a81\n---------------------------------------------------------\n$ git status # \u6839\u636e\u67e5\u770b\u5230\u51b2\u7a81\u4fe1\u606f,\u786e\u5b9a\u662f\u56e0\u4e3a\u91cd\u590d\u4fee\u6539\u4e86a.txt\u540c\u4e00\u884c\u5185\u5bb9\u5bfc\u81f4\u7684\n\n$ vim a.txt  # \u624b\u52a8\u89e3\u51b3\u51b2\u7a81\n\n$ git add a.txt # \u518d\u6b21\u63d0\u4ea4\n$ git commit -m \"conflict fixed\" # \u518d\u6b21\u63d0\u4ea4\n\n\n# 6\u3001\u67e5\u770b\n---------------------------------------------------------\n$  git log --graph --pretty=oneline --abbrev-commit\n*   cb8e739 (HEAD -> master) conflict fixed\n|\\  \n| * d8dba1f (dev) v4\n* | 5e6a978 v5\n|\/  \n* 89e82b8 v3\n* 68d496d v2\n* 04352c4 v1\n* 1452eed v0\n\n# 7\u3001\u6700\u540e\u5220\u9664dev\u5206\u652f\n---------------------------------------------------------\ngit branch -d dev\n\n# 8\u3001\u603b\u7ed3\n---------------------------------------------------------\n\u5f53Git\u65e0\u6cd5\u81ea\u52a8\u5408\u5e76\u5206\u652f\u65f6\uff0c\u5c31\u5fc5\u987b\u9996\u5148\u89e3\u51b3\u51b2\u7a81\u3002\u89e3\u51b3\u51b2\u7a81\u540e\uff0c\u518d\u63d0\u4ea4\uff0c\u5408\u5e76\u5b8c\u6210\u3002\n\n\u89e3\u51b3\u51b2\u7a81\u5c31\u662f\u628aGit\u5408\u5e76\u5931\u8d25\u7684\u6587\u4ef6\u624b\u52a8\u7f16\u8f91\u4e3a\u6211\u4eec\u5e0c\u671b\u7684\u5185\u5bb9\uff0c\u518d\u63d0\u4ea4\u3002\n\n\u7528git log --graph\u547d\u4ee4\u53ef\u4ee5\u770b\u5230\u5206\u652f\u5408\u5e76\u56fe\u3002<\/pre>\n\n\n\n<p><strong>\u4e94 Bug\u5206\u652f<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u200b\u5f00\u53d1\u8f6f\u4ef6\u7684\u8fc7\u7a0b\u4e2d\uff0c\u8f6f\u4ef6\u51fa\u73b0bug\u662f\u975e\u5e38\u6b63\u5e38\u7684\u4e00\u4ef6\u4e8b\uff0c\u5f53\u6211\u4eec\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u9047\u5230\u4e86bug\uff0c\u53ef\u4ee5\u5728\u51fa\u73b0bug\u7684\u5206\u652f\u4e0a\u521b\u5efa\u5e76\u5207\u6362\u5230\u4e00\u4e2a\u4e34\u65f6\u7684\u5b50\u5206\u652f\uff0c\u53ef\u4ee5\u79f0\u4e4b\u4e3abug\u5206\u652f\uff0c\u7136\u540e\u5728\u8be5\u4e34\u65f6\u5b50\u5206\u652f\u4e0a\u4fee\u590dbug\u5e76\u63d0\u4ea4\uff0c\u968f\u540e\u5207\u56de\u51fa\u73b0bug\u7684\u5206\u652f\u4e0a\u5408\u5e76bug\u5206\u652f\u4fee\u590d\u7684\u5185\u5bb9\uff0c\u7136\u540e\u5220\u6389\u4e34\u65f6\u7684bug\u5206\u652f\u5373\u53ef\u3002<\/p>\n\n\n\n<p>\u200b \u5177\u4f53\u573a\u666f\u3002\u3002\u3002<\/p>\n\n\n\n<p>\u200b\u6b64\u65f6\u6211\u4eec\u6b63\u5728dev\u5206\u652f\u4e0a\u8fdb\u884c\u5f00\u53d1\uff0c\u5f00\u53d1\u5de5\u4f5c\u53ea\u8fdb\u884c\u4e86\u4e00\u534a\uff0c\u8fd8\u9700\u8981\u51e0\u5929\u624d\u80fd\u641e\u5b9a\uff0c\u6b64\u65f6\u9886\u5bfc\u4ea4\u7ed9\u4f60\u4e00\u4e2a\u4ee3\u53f7487\u7684bug\u4fee\u590d\u7684\u4efb\u52a1\uff0c\u8981\u6c42\u5728\u4e24\u4e2a\u5c0f\u65f6\u5185\u4fee\u590d\u5b8c\u6210\uff0c\u6b64\u65f6\u4f60\u5fc5\u987b\u653e\u4e0b\u624b\u5934dev\u5206\u652f\u7684\u5f00\u53d1\u4efb\u52a1\u53bb\u4fee\u590dbug\uff0c\u6b64\u65f6dev\u5206\u652f\u672a\u5b8c\u6210\u7684\u5de5\u4f5c\u80af\u5b9a\u662f\u9700\u8981\u4fdd\u5b58\u4e0b\u6765\u4ee5\u4fbfbug\u4fee\u590d\u5b8c\u6210\u540e\u91cd\u65b0\u7ee7\u7eed\u5f00\u53d1\u4e0b\u53bb\u7684\uff0c\u5982\u679c\u628adev\u5206\u652f\u672a\u5b8c\u6210\u7684\u5f00\u53d1\u5185\u5bb9\u76f4\u63a5\u63d0\u4ea4\u4e00\u4e2a\u7248\u672c\u80af\u5b9a\u662f\u53ef\u4ee5\u7684\uff0c\u4f46\u6211\u4eec\u901a\u5e38\u662f\u5728\u5f00\u53d1\u5b8c\u6210\u4e00\u4e2a\u4efb\u52a1\u540e\u624d\u53bb\u63d0\u4ea4\u4e00\u4e2a\u7248\u672c\uff0c\u4f60\u53ea\u5199\u4e00\u884c\u4ee3\u7801\u5c31\u63d0\u4ea4\u4e00\u4e2a\u7248\u672c\uff0c\u90a3\u5c82\u4e0d\u662f\u975e\u5e38\u4e71\uff0c\u6240\u4ee5\u6211\u4eec\u7684\u9700\u6c42\u662f\u60f3\u5728\u4e0d\u63d0\u4ea4\u65b0\u7248\u672c\u7684\u524d\u63d0\u4e0b\u628a\u5f00\u53d1\u7684\u5185\u5bb9\u6682\u5b58\u4e0b\u6765\uff0c\u8fd9\u5c31\u7528\u5230\u4e86git stash\u547d\u4ee4\u4fdd\u5b58\u548c\u6062\u590d\u5de5\u4f5c\u8fdb\u5ea6<\/p>\n\n\n\n<p><strong>\u524d\u63d0\uff1a\u5fc5\u987b\u662f\u5904\u4e8egit\u4e0b\u7684\u6587\u4ef6\uff0c\u4ece\u6765\u672a\u66feadd\u5230git\u7684\u6587\u4ef6\u65e0\u6cd5\u4f7f\u7528\u3002<\/strong><\/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=\"\">stash\u7528\u4e8e\u5c06\u5de5\u4f5c\u533a\u53d1\u751f\u53d8\u5316\u7684\u6240\u6709\u6587\u4ef6\u83b7\u53d6\u4e34\u65f6\u5b58\u50a8\u5728\u201c\u67d0\u4e2a\u5730\u65b9\u201d\uff0c\u5c06\u5de5\u4f5c\u533a\u8fd8\u539f\u5f53\u524d\u7248\u672c\u672a\u64cd\u4f5c\u524d\u7684\u72b6\u6001,\u76f8\u5f53\u4e8e\u53ef\u4ee5\u628a\u5f53\u524d\u5de5\u4f5c\u73b0\u573a\u201c\u50a8\u85cf\u201d\u8d77\u6765\uff1b\nstash\u8fd8\u53ef\u4ee5\u5c06\u4e34\u65f6\u5b58\u50a8\u5728\u201c\u67d0\u4e2a\u5730\u65b9\u201d\u7684\u6587\u4ef6\u518d\u6b21\u62ff\u56de\u5230\u5de5\u4f5c\u533a\uff0c\u76f8\u5f53\u4e8e\u6062\u590d\u73b0\u573a\uff0c\u53ef\u4ee5\u7ee7\u7eed\u5f00\u59cb\u540e\u7eed\u5de5\u4f5c\uff1a\n\n\n#1\u3001\u547d\u4ee4\uff1agit stash\n---------------------------------------------------\n\u4fdd\u5b58\u5f53\u524d\u5de5\u4f5c\u8fdb\u5ea6\uff0c\u5c06\u5de5\u4f5c\u533a\u548c\u6682\u5b58\u533a\u6062\u590d\u5230\u4fee\u6539\u4e4b\u524d\u3002\n\n#2\u3001\u547d\u4ee4\uff1agit stash save message\n---------------------------------------------------\n\u4f5c\u7528\u540c\u4e0a\uff0cmessage\u4e3a\u6b64\u6b21\u8fdb\u5ea6\u4fdd\u5b58\u7684\u8bf4\u660e\u3002\n\n#3\u3001\u547d\u4ee4\uff1agit stash list\n---------------------------------------------------\n\u663e\u793a\u4fdd\u5b58\u7684\u5de5\u4f5c\u8fdb\u5ea6\u5217\u8868\uff0c\u7f16\u53f7\u8d8a\u5c0f\u4ee3\u8868\u4fdd\u5b58\u8fdb\u5ea6\u7684\u65f6\u95f4\u8d8a\u8fd1\u3002\n\n#4\u3001\u547d\u4ee4\uff1agit stash pop stash@{num}  # \u547d\u4ee44=\u547d\u4ee45+\u547d\u4ee46\n---------------------------------------------------\n\u6062\u590d\u5de5\u4f5c\u8fdb\u5ea6\u5230\u5de5\u4f5c\u533a\uff0c\u6b64\u547d\u4ee4\u7684stash@{num}\u662f\u53ef\u9009\u9879\uff0c\u5728\u591a\u4e2a\u5de5\u4f5c\u8fdb\u5ea6\u4e2d\u53ef\u4ee5\u9009\u62e9\u6062\u590d\uff0c\u4e0d\u5e26\u6b64\u9879\u5219\u9ed8\u8ba4\u6062\u590d\u6700\u8fd1\u7684\u4e00\u6b21\u8fdb\u5ea6\u76f8\u5f53\u4e8egit stash pop stash@{0}\n\n#5\u3001\u547d\u4ee4\uff1agit stash apply stash@{num}\n---------------------------------------------------\n\u6062\u590d\u5de5\u4f5c\u8fdb\u5ea6\u5230\u5de5\u4f5c\u533a\u4e14\u8be5\u5de5\u4f5c\u8fdb\u5ea6\u53ef\u91cd\u590d\u6062\u590d\uff0c\u6b64\u547d\u4ee4\u7684stash@{num}\u662f\u53ef\u9009\u9879\uff0c\u5728\u591a\u4e2a\u5de5\u4f5c\u8fdb\u5ea6\u4e2d\u53ef\u4ee5\u9009\u62e9\u6062\u590d\uff0c\u4e0d\u5e26\u6b64\u9879\u5219\u9ed8\u8ba4\u6062\u590d\u6700\u8fd1\u7684\u4e00\u6b21\u8fdb\u5ea6\u76f8\u5f53\u4e8egit stash apply stash@{0}\n\n#6\u3001\u547d\u4ee4\uff1agit stash drop stash@{num}\n---------------------------------------------------\n\u5220\u9664\u4e00\u6761\u4fdd\u5b58\u7684\u5de5\u4f5c\u8fdb\u5ea6\uff0c\u6b64\u547d\u4ee4\u7684stash@{num}\u662f\u53ef\u9009\u9879\uff0c\u5728\u591a\u4e2a\u5de5\u4f5c\u8fdb\u5ea6\u4e2d\u53ef\u4ee5\u9009\u62e9\u5220\u9664\uff0c\u4e0d\u5e26\u6b64\u9879\u5219\u9ed8\u8ba4\u5220\u9664\u6700\u8fd1\u7684\u4e00\u6b21\u8fdb\u5ea6\u76f8\u5f53\u4e8egit stash drop stash@{0}\n\n#7\u3001\u547d\u4ee4\uff1agit stash clear\n---------------------------------------------------\n\u5220\u9664\u6240\u6709\u4fdd\u5b58\u7684\u5de5\u4f5c\u8fdb\u5ea6\u3002<\/pre>\n\n\n\n<p><strong>\u793a\u4f8b<\/strong><\/p>\n\n\n\n<p>1\u3001\u5728dev\u5206\u652f\u6b63\u5728\u8fdb\u884c\u5f00\u53d1\u4efb\u52a1\uff0c\u5f00\u53d1\u5230\u4e00\u534a\uff0c\u9047\u5230\u4e86\u8981\u5728\u4e24\u5c0f\u65f6\u4fee\u590d\u4ee3\u53f7487\u7684bug\uff0c\u5148\u4fdd\u5b58\u5de5\u4f5c\u73b0\u573a\uff0c\u5c06\u5de5\u4f5c\u533a\u548c\u6682\u5b58\u533a\u8fd8\u539f\u5230\u4fee\u6539\u4e4b\u524d<\/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 checkout dev\nAlready on 'dev'\n$ ls\na.txt b.txt c.txt d.txt\n\n$ echo 111 >> a.txt  # \u5f80\u6587\u4ef6a.txt\u6dfb\u52a0\u5185\u5bb9\n$ echo \"eee\" > e.txt  # \u65b0\u589e\u65b0\u6587\u4ef6\n$ git add e.txt       # e.txt\u5c5e\u4e8e\u9996\u6b21\u65b0\u589e\uff0c\u9700\u8981add\n\n$ git stash\nSaved working directory and index state WIP on dev: d8dba1f v4<\/pre>\n\n\n\n<p>2\u3001\u5207\u6362\u5230\u51fa\u73b0bug\u7684\u5206\u652f\u4e0b\uff08\u5047\u8bbe\u6b64\u65f6\u4e3amaster\u5206\u652f\uff09\uff0c\u521b\u5efa\u5b50\u5206\u652f\uff0c\u5728\u5b50\u5206\u652f\u4e0a\u4fee\u6539bug<\/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 checkout master\n$ git checkout -b issue-487\n\n$ vim b.txt  # \u4fee\u590dbug\uff0c\u52a0\u4e0a\u6dfb\u52a0\u4e86\u4e00\u6837\u5185\u5bb9fixed bug\n\n# \u4fee\u590d\u5b8c\u6210\u540e\u63d0\u4ea4\u4e00\u4e2a\u7248\u672c\n$ git add b.txt \n$ git commit -m \"fix bug 487\"\n[master 354e562] fix bug 487<\/pre>\n\n\n\n<p>3\u3001\u4fee\u590d\u5b8c\u6210\u540e\uff0c\u5207\u6362\u5230<code>master<\/code>\u5206\u652f\uff0c\u5e76\u5b8c\u6210\u5408\u5e76\uff0c\u6700\u540e\u5220\u9664<code>issue-487<\/code>\u5206\u652f\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=\"\">git checkout master\ngit merge --no-ff -m \"merged bug fix 487\" issue-487\ngit branch -d issue-487<\/pre>\n\n\n\n<p>4\u3001\u91cd\u65b0\u5207\u56dedev\u5206\u652f\uff0c\u628astash\u7684\u5185\u5bb9\u62ff\u56de\u6765\uff0c\u7ee7\u7eed\u5e72\u6d3b<\/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=\"\">it checkout dev\ngit status\ngit stash list  # \u53ef\u4ee5\u770b\u5230\u6709\u5f53\u521d\u6682\u5b58\u7684\u5de5\u4f5c\u73b0\u573a\ngit stash pop\ngit stash list # \u65e0\u5185\u5bb9\n\n#ps\n\u4f60\u53ef\u4ee5\u591a\u6b21stash\uff0c\u6062\u590d\u7684\u65f6\u5019\uff0c\u5148\u7528git stash list\u67e5\u770b\uff0c\u7136\u540e\u6062\u590d\u6307\u5b9a\u7684stash\uff0c\u7528\u547d\u4ee4\uff1a\ngit stash apply stash@{0}<\/pre>\n\n\n\n<p>\u601d\u8003\uff1a<\/p>\n\n\n\n<p>dev\u5206\u652f\u5f53\u521d\u5c31\u662f\u4ecemaster\u5206\u652f\u5206\u51fa\u6765\u7684\uff0c\u6240\u4ee5dev\u4e0emaster\u7684\u6e90\u5934\u4e00\u6837\uff0c\u5982\u679c\u8bf4master\u4e0a\u7684\u67d0\u4e2a\u8282\u70b9\u6709bug\uff0c\u5e76\u4e14\u8be5\u8282\u70b9\u5904\u4e8edev\u5206\u652f\u4e4b\u524d\uff0c\u90a3\u4e48dev\u5206\u652f\u4e0a\u80af\u5b9a\u4e5f\u6709\u8be5bug\uff0c\u90a3\u5982\u4f55\u4fee\u590d\u5462\uff1f\u91cd\u590d\u4e0a\u8ff0\u64cd\u4f5c\u80af\u5b9a\u53ef\u4ee5\uff0c\u4f46\u91cd\u590d\u64cd\u4f5c\u6bd5\u7adf\u4e0d\u662f\u90a3\u4e48\u806a\u660e\uff0c\u6211\u4eec\u5176\u5b9e\u53ef\u4ee5\u8fd9\u4e48\u505a<\/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=\"\">\u540c\u6837\u7684bug\u5982\u679c\u4e5f\u60f3\u5728dev\u4e0a\u4fee\u590d\uff0c\u800c\u4e0d\u662f\u628a\u6574\u4e2amaster\u5206\u652fmerge\u5230\u5f53\u524d\u7684dev\u5206\u652f\ngit\u63d0\u4f9b\u4e86\u4e00\u4e2acherry-pick\u547d\u4ee4\uff0c\u53ea\u628a\u5355\u72ec\u90a3\u4e2abug\u63d0\u4ea4\u6240\u505a\u7684\u4fee\u6539\u590d\u5236\u5230\u5f53\u524ddev\u5206\u652f\n\n$ git branch\n  dev\n* master\n\n$ git log --graph --pretty=oneline --abbrev-commit\n*   1331818 (HEAD -> master) merged bug fix 487\n|\\  \n| * 50be59d fix bug 487 # \u4fee\u590dbug\u7684\u63d0\u4ea4\n|\/  \n*   cb8e739 conflict fixed\n|\\  \n| * d8dba1f (dev) v4\n* | 5e6a978 v6\n|\/  \n* 89e82b8 v3\n* 68d496d v2\n* 04352c4 v1\n* 1452eed v0\n\n$ git checkout dev\nSwitched to branch 'dev'\n\n$ git cherry-pick 50be59d\n[dev aee0ea6] fix bug 487\n Date: Wed Jul 15 20:41:47 2020 +0800\n 1 file changed, 1 insertion(+)\n\n$ cat b.txt # b.txt\nbbb\nfixed bug\n<\/pre>\n\n\n\n<p>\u7528<code>git cherry-pick<\/code>\uff0c\u6211\u4eec\u5c31\u4e0d\u9700\u8981\u5728dev\u5206\u652f\u4e0a\u624b\u52a8\u518d\u628a\u4feebug\u7684\u8fc7\u7a0b\u91cd\u590d\u4e00\u904d\u3002<\/p>\n\n\n\n<p>\u6709\u4e9b\u806a\u660e\u7684\u7ae5\u978b\u4f1a\u60f3\u4e86\uff0c\u65e2\u7136\u53ef\u4ee5\u5728master\u5206\u652f\u4e0a\u4fee\u590dbug\u540e\uff0c\u5728dev\u5206\u652f\u4e0a\u53ef\u4ee5\u201c\u91cd\u653e\u201d\u8fd9\u4e2a\u4fee\u590d\u8fc7\u7a0b\uff0c\u90a3\u4e48\u76f4\u63a5\u5728dev\u5206\u652f\u4e0a\u4fee\u590dbug\uff0c\u7136\u540e\u5728master\u5206\u652f\u4e0a\u201c\u91cd\u653e\u201d\u884c\u4e0d\u884c\uff1f\u5f53\u7136\u53ef\u4ee5\uff0c\u4e0d\u8fc7\u4f60\u4ecd\u7136\u9700\u8981<code>git stash<\/code>\u547d\u4ee4\u4fdd\u5b58\u73b0\u573a\uff0c\u624d\u80fd\u4ecedev\u5206\u652f\u5207\u6362\u5230master\u5206\u652f\u3002<\/p>\n\n\n\n<p><strong>\u516d Feature\u5206\u652f<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><code>master<\/code>\u5206\u652f\u5e94\u8be5\u662f\u975e\u5e38\u7a33\u5b9a\u7684\uff0c\u4e5f\u5c31\u662f\u4ec5\u7528\u6765\u53d1\u5e03\u65b0\u7248\u672c\uff0c\u4e3a\u4e86\u9632\u6b62\u641e\u4e71\uff0c\u5e73\u65f6\u4e0d\u80fd\u5728\u4e0a\u9762\u5e72\u6d3b\uff0c\u6211\u4eec\u901a\u5e38\u5728dev\u5206\u652f\u4e0a\u5f00\u53d1\u4ee3\u7801\uff0c\u800c\u5f00\u53d1\u7684\u8fc7\u7a0b\u4e2d\u80af\u5b9a\u6d89\u53ca\u5230\u4e94\u82b1\u516b\u95e8\u5404\u79cd\u5404\u6837\u7684\u529f\u80fd\u8981\u6dfb\u52a0\u5230\u8f6f\u4ef6\u4e2d\uff0c\u4e3a\u4e86\u4e0d\u8ba9\u65b0\u529f\u80fd\u7684\u4ee3\u7801\u641e\u4e71dev\uff0c\u6211\u4eec\u540c\u6837\u5e94\u8be5\u5728dev\u4e0a\u5f00\u8f9f\u5b50\u5206\u652f\uff0c\u79f0\u4e4b\u4e3afeature\u5206\u652f\uff0c\u5728feature\u4e0a\u5f00\u53d1\u5b8c\u6bd5\u540e\uff0c\u518d\u5207\u56dedev\u5206\u652f\u8fdb\u884c\u5408\u5e76\uff0c\u7136\u540e\u5220\u9664\u6389featrue\u5206\u652f\u5373\u53ef<\/p>\n\n\n\n<p>\u73b0\u5728\uff0c\u4f60\u7ec8\u4e8e\u63a5\u5230\u4e86\u4e00\u4e2a\u65b0\u4efb\u52a1\uff1a\u5f00\u53d1\u4ee3\u53f7\u4e3a\u7eff\u5e3d\u5b50\u7684\u65b0\u529f\u80fd\uff0c\u8be5\u529f\u80fd\u8ba1\u5212\u7528\u4e8e\u4e3a\u5168\u4e16\u754c\u7684\u7537\u4eba\u6234\u4e0a\u7eff\u5e3d\u5b50\u3002<\/p>\n\n\n\n<p>\u4e8e\u662f\u4f60\u51c6\u5907\u5f00\u59cb<\/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 branch\n* dev\n  master\n\n$ git checkout -b 'feauture-greenhat'\nSwitched to a new branch 'feauture-greenhat'\n\n$ touch greenhat.py  # \u5f00\u53d1\u5b8c\u6bd5\n$ git add greenhat.py \n$ git commit -m \"add feature greenhat\"<\/pre>\n\n\n\n<p>\u5207\u56dedev\u5206\u652f\uff0c\u51c6\u5907\u5408\u5e76<\/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 checkout dev\nSwitched to branch 'dev'<\/pre>\n\n\n\n<p>\u4e00\u5207\u987a\u5229\u7684\u8bdd\uff0cfeature\u5206\u652f\u548cbug\u5206\u652f\u90fd\u662f\u7c7b\u4f3c\u7684\u5904\u7406\u65b9\u5f0f\uff0c\u5408\u5e76\uff0c\u7136\u540e\u5220\u9664\u5373\u53ef\u3002<\/p>\n\n\n\n<p>\u4f46\u662f\uff01<\/p>\n\n\n\n<p>\u5c31\u5728\u6b64\u65f6\uff0c\u63a5\u5230\u4e0a\u7ea7\u547d\u4ee4\uff0c\u56e0\u7ecf\u8d39\u4e0d\u8db3\uff0c\u65b0\u529f\u80fd\u5fc5\u987b\u53d6\u6d88\uff01<\/p>\n\n\n\n<p>\u867d\u7136\u767d\u5e72\u4e86\uff0c\u4f46\u662f\u8fd9\u4e2a\u5305\u542b\u673a\u5bc6\u8d44\u6599\u7684\u5206\u652f\u8fd8\u662f\u5fc5\u987b\u5c31\u5730\u9500\u6bc1\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=\"\">$ git branch -d 'feauture-greenhat'\nerror: The branch 'feauture-greenhat' is not fully merged.\nIf you are sure you want to delete it, run 'git branch -D feauture-greenhat'.\n\u9500\u6bc1\u5931\u8d25\u3002Git\u53cb\u60c5\u63d0\u9192\uff0cfeature-vulcan\u5206\u652f\u8fd8\u6ca1\u6709\u88ab\u5408\u5e76\uff0c\u5982\u679c\u5220\u9664\uff0c\u5c06\u4e22\u5931\u6389\u4fee\u6539\uff0c\u5982\u679c\u8981\u5f3a\u884c\u5220\u9664\uff0c\u9700\u8981\u4f7f\u7528\u5927\u5199\u7684-D\u53c2\u6570\u3002\u3002\n\n# \u73b0\u5728\u6211\u4eec\u5f3a\u884c\u5220\u9664\uff1a\n$ git branch -D feauture-greenhat\nDeleted branch feature-vulcan (was 287773e).<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00 \u3001\u5206\u652f\u4ecb\u7ecd \u5982\u679c\u628aGit\u6bd4\u55bb\u4e3a\u4e00\u6761\u5c0f\u6cb3\uff0cmaster\u5206\u652f\u662f\u5c0f\u6cb3\u7684\u4e3b\u5e72\/\u4e3b\u5206\u652f\uff0c\u5176\u4ed6\u5206\u652f\u5c31\u662f\u8fd9\u6761\u5c0f\u6cb3\u7684\u652f\u6d41\uff0c [&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\/8714"}],"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=8714"}],"version-history":[{"count":6,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/8714\/revisions"}],"predecessor-version":[{"id":8740,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/8714\/revisions\/8740"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}