{"id":12743,"date":"2023-09-20T12:58:21","date_gmt":"2023-09-20T04:58:21","guid":{"rendered":"https:\/\/92it.top\/?p=12743"},"modified":"2023-09-20T12:58:38","modified_gmt":"2023-09-20T04:58:38","slug":"git-pull-%e5%92%8c-git-fetch%e5%88%b0%e5%ba%95%e4%bb%80%e4%b9%88%e5%8c%ba%e5%88%ab%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=12743","title":{"rendered":"git pull \u548c git fetch\u5230\u5e95\u4ec0\u4e48\u533a\u522b\uff1f"},"content":{"rendered":"\n<p><strong>\u524d\u8a00<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>Git\u662f\u4e00\u6b3e\u975e\u5e38\u53d7\u6b22\u8fce\uff0c\u4e5f\u975e\u5e38\u5f3a\u5927\u7684\u7248\u672c\u7ba1\u7406\u5de5\u5177\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-23.png\" alt=\"\" class=\"wp-image-12744\" width=\"407\" height=\"260\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-23.png 736w, https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-23-300x192.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-23-230x147.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-23-350x224.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-23-480x307.png 480w\" sizes=\"(max-width: 407px) 100vw, 407px\" \/><\/figure><\/div>\n\n\n\n<p>\u4f46\u662f\uff0c\u5b83\u7684\u5de5\u4f5c\u6d41\u7a0b\u76f8\u5bf9\u4e8eSVN\u7b49\u5176\u4ed6\u7248\u672c\u7ba1\u7406\u5de5\u4f5c\u4e5f\u590d\u6742\u5f88\u591a\uff0c\u5bf9\u4e8e\u521a\u63a5\u89e6\u7684\u540c\u5b66\u4f1a\u6709\u5f88\u591a\u64cd\u4f5c\u96be\u4ee5\u7406\u89e3\u3002<\/p>\n\n\n\n<p>\u4f8b\u5982\uff0c\u5f53\u6211\u4eec\u548c\u5176\u4ed6\u540c\u5b66\u8fdb\u884c\u534f\u540c\u5f00\u53d1\u65f6\uff0c\u6211\u4eec\u6bcf\u4e2a\u4eba\u90fd\u4ece\u8fdc\u7a0b\u4ed3\u5e93\u62c9\u53d6\u4e86\u4e00\u4efd\u4ee3\u7801\u5230\u672c\u5730\u4ed3\u5e93\uff0c\u6b64\u65f6\u6bcf\u4e2a\u4eba\u7535\u8111\u4e0a\u7684\u672c\u5730\u4ed3\u5e93\u548c\u8fdc\u7a0b\u4ed3\u5e93\u90fd\u662f\u4e00\u81f4\u7684\u3002<\/p>\n\n\n\n<p>\u4f46\u662f\uff0c\u968f\u7740\u5f00\u53d1\u7684\u4e0d\u65ad\u63a8\u8fdb\uff0c\u5982\u679c\u5176\u4ed6\u540c\u4e8b\u4e8b\u5148\u5df2\u7ecf\u628a\u4fee\u6539\u7684\u4ee3\u7801\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\uff0c\u5f53\u6211\u4eec\u540e\u9762\u518dpush\u65f6\u5c31\u4f1a\u53d1\u751f\u51b2\u7a81\u3002<\/p>\n\n\n\n<p>\u8fd9\u65f6\u5019\uff0c\u5c31\u9700\u8981\u5148\u628a\u8fdc\u7a0b\u4ee3\u7801\u7684\u6700\u65b0\u7248\u672c\u91cd\u65b0\u62c9\u53d6\u4e00\u4e0b\u5230\u672c\u5730\u4ed3\u5e93\uff0c\u8fd9\u65f6\u5019\uff0c\u5c31\u4f1a\u7528\u5230<code>git pull<\/code>\u548c<code>git fetch<\/code>\u3002<\/p>\n\n\n\n<p>\u5728\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\uff0c\u5f88\u591a\u540c\u5b66\u5c31\u6709\u70b9\u5206\u4e0d\u6e05\u4e86\uff0c\u90fd\u662f\u62c9\u53d6\u8fdc\u7a0b\u4ed3\u5e93\u7684\u4ee3\u7801\u5230\u672c\u5730\u4ed3\u5e93\uff0c\u5b83\u4eec\u7684\u533a\u522b\u662f\u4ec0\u4e48\u5462\uff1f<\/p>\n\n\n\n<p>\u8981\u60f3\u7406\u89e3\u5b83\u4eec\u7684\u5de5\u4f5c\u613f\u610f\uff0c\u9996\u5148\u8981\u5bf9Git\u4ed3\u5e93\u6709\u4e00\u4e2a\u6e05\u6670\u7684\u8ba4\u8bc6\u3002<\/p>\n\n\n\n<p>\u5728\u6211\u4eec\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u4ee3\u7801\u4ed3\u5e93\u81f3\u5c11\u4f1a\u67093\u4e2a\u4ed3\u5e93\/\u526f\u672c\uff1a<\/p>\n\n\n\n<ul><li><strong>\u672c\u5730\u5de5\u4f5c\u76ee\u5f55<\/strong>\uff1a\u4e5f\u5c31\u662f\u6211\u4eec\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u6b63\u5728\u7f16\u8f91\u7684\u5de5\u4f5c\u76ee\u5f55<\/li><li><strong>\u672c\u5730\u4ed3\u5e93<\/strong>\uff1a\u8fd9\u4e00\u70b9\u662f\u5f88\u591a\u521d\u5b66\u8005\u5bb9\u6613\u5ffd\u7565\u548c\u641e\u6df7\u7684\uff0c\u7531\u4e8egit\u662f\u5206\u5e03\u5f0f\u7684\uff0c\u6240\u4ee5\u6bcf\u4e2a\u5f00\u53d1\u8005\u672c\u5730\u90fd\u4f1a\u6709\u4e00\u4e2a\u672c\u5730\u4ed3\u5e93\uff0c\u5f53\u6211\u4eec\u901a\u8fc7git commit\u63d0\u4ea4\u4ee3\u7801\u65f6\uff0c\u66f4\u6539\u5c31\u4ece\u672c\u5730\u5de5\u4f5c\u76ee\u5f55\u63d0\u4ea4\u5230\u4e86\u672c\u5730\u4ed3\u5e93<\/li><li><strong>\u8fdc\u7a0b\u4ed3\u5e93<\/strong>\uff1a\u8fd9\u4e2a\u5e94\u8be5\u5927\u591a\u6570\u540c\u5b66\u90fd\u5f88\u6e05\u695a\uff0c\u987e\u540d\u601d\u4e49\uff0c\u5c31\u662f\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u5b58\u50a8\u7684\u4ed3\u5e93\uff0c\u4f8b\u5982Github\u3001Gitlab\uff0c\u5f53\u6211\u4eec\u4f7f\u7528git push\u63a8\u9001\u4ee3\u7801\u65f6\uff0c\u4ee3\u7801\u5c31\u4ece\u672c\u5730\u4ed3\u5e93\u63a8\u5230\u4e86\u8fdc\u7a0b\u4ed3\u5e93<\/li><\/ul>\n\n\n\n<p>\u5728\u5f88\u591a\u521a\u63a5\u89e6Git\u7684\u540c\u5b66\u610f\u8bc6\u91cc\uff0c\u5bb9\u6613\u7406\u89e3\u672c\u5730\u5de5\u4f5c\u76ee\u5f55\u548c\u8fdc\u7a0b\u76ee\u5f55\uff0c\u8ba4\u4e3a\u6267\u884ccommit\u548cpush\u5c31\u662f\u76f4\u63a5\u4ece\u672c\u5730\u5de5\u4f5c\u76ee\u5f55\u63a8\u5230\u4e86\u8fdc\u7a0b\u4ed3\u5e93\uff0c\u5bb9\u6613\u5ffd\u7565\u672c\u5730\u4ed3\u5e93\u3002<\/p>\n\n\n\n<p>\u73b0\u5728\uff0c\u7406\u89e3\u4e86Git\u7684\u5de5\u4f5c\u6d41\uff0c\u63a5\u4e0b\u6765\u518d\u89e3\u91ca<code>git pull<\/code>\u548c<code>git fetch<\/code>\u7684\u533a\u522b\u5c31\u7b80\u5355\u591a\u4e86\u3002<\/p>\n\n\n\n<p>\u5c31\u5982\u540c\u524d\u9762\u63d0\u5230\u7684\uff0c\u5f88\u591a\u540c\u4e8b\u534f\u540c\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u5e76\u4e0d\u662f\u540c\u6b65\u7684\u3002\u4f8b\u5982\uff0cA\u548cB\u4e24\u4f4d\u5f00\u53d1\u8005\u90fd\u4ece\u8fdc\u7a0b\u4ed3\u5e93\u62c9\u4e86\u4e00\u4efd\u6700\u65b0\u6570\u636e\u5230\u672c\u5730\u4ed3\u5e93\uff0cA\u4fee\u6539\u4e86\u4ee3\u7801\u4e4b\u540e\u5148\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\u4e86\uff0c\u8fd9\u65f6\u5019B\u7684\u672c\u5730\u4ed3\u5e93\u4ee3\u7801\u548c\u8fdc\u7a0b\u4ed3\u5e93\u7684\u5c31\u4e0d\u4e00\u6837\u4e86\u3002\u5982\u679c\u8fd9\u65f6\u5019\u76f4\u63a5push\u5c31\u4f1a\u5f15\u8d77\u51b2\u7a81\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5\uff0c\u534f\u540c\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u5728\u63a8\u9001\u4ee3\u7801\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u5148\u68c0\u67e5\u4e00\u4e0b\u672c\u5730\u4ed3\u5e93\u4e0e\u8fdc\u7a0b\u4ed3\u5e93\u7684\u5dee\u5f02\uff0c\u7136\u540e\u628a\u6700\u65b0\u7684\u4ee3\u7801\u62c9\u5230\u672c\u5730\uff0c\u7136\u540e\u518d\u63d0\u4ea4\u3001\u63a8\u9001\u3002<\/p>\n\n\n\n<p>\u8fd9\u65f6\u5019\u5c31\u4f1a\u7528\u5230<code>git pull<\/code>\u548c<code>git fetch<\/code>\uff0c\u5b83\u4eec\u5728\u5b8c\u6210\u76f8\u540c\u7684\u5de5\u4f5c\uff0c\u53ea\u662f\u5904\u7406\u65b9\u5f0f\u4e0d\u540c\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-24.png\" alt=\"\" class=\"wp-image-12745\" width=\"263\" height=\"234\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-24.png 558w, https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-24-300x267.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-24-230x204.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-24-350x311.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-24-480x427.png 480w\" sizes=\"(max-width: 263px) 100vw, 263px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-25-1024x306.png\" alt=\"\" class=\"wp-image-12746\" width=\"448\" height=\"134\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-25-1024x306.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-25-300x90.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-25-768x230.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-25-1536x459.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-25-830x248.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-25-230x69.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-25-350x105.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-25-480x143.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/09\/\u56fe\u7247-25.png 1646w\" sizes=\"(max-width: 448px) 100vw, 448px\" \/><\/figure><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>git fetch<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u5728\u62c9\u53d6\u4ee3\u7801\u8fc7\u7a0b\u4e2d\uff0cgit fetch\u4f1a\u9996\u5148\u68c0\u67e5\u672c\u5730\u4ed3\u5e93\u548c\u8fdc\u7a0b\u4ed3\u5e93\u7684\u5dee\u5f02\uff0c\u68c0\u67e5\u54ea\u4e9b\u4e0d\u5b58\u5728\u4e8e\u672c\u5730\u4ed3\u5e93\uff0c\u7136\u540e\u5c06\u8fd9\u4e9b\u53d8\u52a8\u7684\u63d0\u4ea4\u62c9\u53d6\u5230\u672c\u5730\u3002<\/p>\n\n\n\n<p>\u4f46\u662f\uff0c\u8fd9\u91cc\u8bf7\u6ce8\u610f\uff0c\u5b83\u662f\u628a\u8fdc\u7a0b\u63d0\u4ea4\u62c9\u53d6\u5230\u672c\u5730\u4ed3\u5e93\uff0c\u800c\u4e0d\u662f\u672c\u5730\u5de5\u4f5c\u76ee\u5f55\uff0c\u5b83\u4e0d\u4f1a\u81ea\u884c\u5c06\u8fd9\u4e9b\u65b0\u6570\u636e\u5408\u5e76\u5230\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u7ee7\u7eed\u6267\u884cgit merge\u624d\u4f1a\u628a\u8fd9\u4e9b\u53d8\u52a8\u5408\u5e76\u5230\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u3002<\/p>\n\n\n\n<p><strong>git pull<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u800c<code>git pull<\/code> \u5219\u662f\u5c06\u8fdc\u7a0b\u4e3b\u673a\u7684\u6700\u65b0\u5185\u5bb9\u62c9\u4e0b\u6765\u540e\u76f4\u63a5\u5408\u5e76\uff0c\u5373\uff1a<code>git pull = git fetch + git merge<\/code>\uff0c\u8fd9\u6837\u53ef\u80fd\u4f1a\u4ea7\u751f\u51b2\u7a81\uff0c\u9700\u8981\u624b\u52a8\u89e3\u51b3\u3002<\/p>\n\n\n\n<p>git pull\u548cgit fetch\u521a\u597d\u76f8\u53cd\uff0c\u5b83\u76f4\u63a5\u83b7\u53d6\u8fdc\u7a0b\u7684\u6700\u65b0\u63d0\u4ea4\uff0c\u76f4\u63a5\u62c9\u53d6\u5e76\u5408\u5e76\u5230\u672c\u5730\u5de5\u4f5c\u76ee\u5f55\uff0c\u800c\u4e14\u5728\u5408\u5e76\u8fc7\u7a0b\u4e2d\u4e0d\u4f1a\u7ecf\u8fc7\u6211\u4eec\u7684\u5ba1\u67e5\uff0c\u5982\u679c\u4e0d\u4ed4\u7ec6\u68c0\u67e5\uff0c\u8fd9\u6837\u5f88\u5bb9\u6613\u9047\u5230\u51b2\u7a81\u3002<\/p>\n\n\n\n<p>\u7406\u89e3\u4e86git pull\u548cgit fetch\u7684\u533a\u522b\uff0c\u90a3\u4e48\u8be5\u7528\u54ea\u79cd\u65b9\u5f0f\u5462\uff1f<\/p>\n\n\n\n<p>\u76f8\u6bd4\u4e4b\u4e0b\uff0cgit fetch\u662f\u4e00\u4e2a\u66f4\u5b89\u5168\u7684\u9009\u62e9\uff0c\u56e0\u4e3a\u5b83\u4ece\u4f60\u7684\u8fdc\u7a0b\u4ed3\u5e93\u62c9\u5165\u6240\u6709\u7684\u63d0\u4ea4\uff0c\u4f46\u4e0d\u4f1a\u5bf9\u4f60\u7684\u672c\u5730\u6587\u4ef6\u505a\u4efb\u4f55\u4fee\u6539\u3002<\/p>\n\n\n\n<p>\u8fd9\u7ed9\u4e86\u4f60\u8db3\u591f\u65f6\u95f4\u53bb\u53d1\u73b0\u8fdc\u7a0b\u4ed3\u5e93\u81ea\u4ece\u4f60\u4e0a\u6b21\u62c9\u53d6\u540e\u5230\u73b0\u5728\u4e3a\u6b62\u53d1\u751f\u7684\u53d8\u5316\u3002<\/p>\n\n\n\n<p>\u4f60\u53ef\u4ee5\u5728\u5408\u5e76\u524d\u68c0\u67e5\u54ea\u4e9b\u6587\u4ef6\u6709\u53d8\u5316\uff0c\u54ea\u4e9b\u6587\u4ef6\u53ef\u80fd\u5bfc\u81f4\u51b2\u7a81\u3002<\/p>\n\n\n\n<p>\u800cgit pull\u76f8\u5f53\u4e8e\u8fd0\u884cgit fetch\uff0c\u7136\u540e\u7acb\u5373\u5c06\u4f60\u7684\u6539\u52a8\u5408\u5e76\u5230\u672c\u5730\u4ed3\u5e93\u3002<\/p>\n\n\n\n<p>\u8fd9\u6837\u7684\u786e\u5c11\u4e86\u4e00\u4e2a\u6b65\u9aa4\uff0c\u4f46\u662f\u4e5f\u4f1a\u5e26\u6765\u4e00\u4e9b\u98ce\u9669\u3002<\/p>\n\n\n\n<p>\u4f5c\u4e3a\u4e00\u540d\u5f00\u53d1\u8005\uff0c\u5728\u9879\u76ee\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u5f88\u96be\u7ed5\u5f00git\uff0c\u53ea\u6709\u6df1\u5165\u7406\u89e3git\u7684\u5de5\u4f5c\u539f\u7406\u624d\u80fd\u5728\u5de5\u4f5c\u4e2d\u66f4\u52a0\u81ea\u5982\u7684\u5e94\u7528Git\u5b8c\u6210\u9879\u76ee\u534f\u540c\u5f00\u53d1\uff0c\u5982\u679c\u4e00\u76f4\u5904\u4e8e\u4e00\u77e5\u534a\u89e3\u7684\u72b6\u6001\uff0c\u5728\u7248\u672c\u63a7\u5236\u4e2d\u7ecf\u5e38\u4f1a\u9047\u5230\u5404\u79cd\u5404\u6837\u7684\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 Git\u662f\u4e00\u6b3e\u975e\u5e38\u53d7\u6b22\u8fce\uff0c\u4e5f\u975e\u5e38\u5f3a\u5927\u7684\u7248\u672c\u7ba1\u7406\u5de5\u5177\u3002 \u4f46\u662f\uff0c\u5b83\u7684\u5de5\u4f5c\u6d41\u7a0b\u76f8\u5bf9\u4e8eSVN\u7b49\u5176\u4ed6\u7248\u672c\u7ba1\u7406\u5de5\u4f5c\u4e5f\u590d [&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\/12743"}],"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=12743"}],"version-history":[{"count":2,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/12743\/revisions"}],"predecessor-version":[{"id":12748,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/12743\/revisions\/12748"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12743"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}