{"id":19577,"date":"2024-11-19T09:29:22","date_gmt":"2024-11-19T01:29:22","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19577\/"},"modified":"2024-11-19T09:29:22","modified_gmt":"2024-11-19T01:29:22","slug":"%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3git-pull%e6%8a%a5%e9%94%99%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19577\/","title":{"rendered":"\u5982\u4f55\u89e3\u51b3git pull\u62a5\u9519\u95ee\u9898"},"content":{"rendered":"<p>\u5728\u4f7f\u7528git\u8fdb\u884c\u4ee3\u7801\u7ba1\u7406\u65f6\uff0c\u7ecf\u5e38\u4f1a\u7528\u5230git pull\u547d\u4ee4\u6765\u62c9\u53d6\u6700\u65b0\u7684\u4ee3\u7801\u3002\u4f46\u662f\uff0c\u5728\u4f7f\u7528git pull\u65f6\uff0c\u6709\u65f6\u5019\u4f1a\u9047\u5230\u62a5\u9519\u7684\u60c5\u51b5\uff0c\u5982\u4f55\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\u5462\uff1f<\/p>\n<p>\u672c\u6587\u5c06\u4ece\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762\u4ecb\u7ecd\u5982\u4f55\u89e3\u51b3git pull\u62a5\u9519\u95ee\u9898\uff1a<\/p>\n<ol>\n<li>\u5206\u6790\u9519\u8bef\u4fe1\u606f<\/li>\n<li>\u67e5\u770bgit log<\/li>\n<li>\u53d6\u6d88\u672c\u5730\u4fee\u6539<\/li>\n<li>\u6e05\u7406\u7f13\u5b58<\/li>\n<li>\u6dfb\u52a0\u8fdc\u7a0b\u4ed3\u5e93<\/li>\n<li>\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5<\/li>\n<li>\u5206\u6790\u9519\u8bef\u4fe1\u606f<\/li>\n<\/ol>\n<p>\u5982\u679cgit pull\u53d1\u751f\u9519\u8bef\uff0c\u9996\u5148\u9700\u8981\u5206\u6790\u9519\u8bef\u4fe1\u606f\uff0c\u627e\u51fa\u95ee\u9898\u6240\u5728\u3002\u5728git\u62a5\u9519\u7684\u60c5\u51b5\u4e0b\uff0c\u4e00\u822c\u4f1a\u63d0\u793a\u51fa\u9519\u4fe1\u606f\uff0c\u8fd9\u65f6\u6211\u4eec\u8981\u7ed3\u5408\u8fd9\u4e2a\u4fe1\u606f\u6765\u5224\u5b9a\u95ee\u9898\u6240\u5728\uff0c\u67e5\u627e\u89e3\u51b3\u65b9\u6cd5\u3002<\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre>fatal: Could not read from remote repository.\nPlease make sure you have the correct access rights\nand the repository exists.<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u4e2a\u9519\u8bef\u4fe1\u606f\u5c31\u8868\u660e\u4e86\u6211\u4eec\u6ca1\u6709\u6743\u9650\u8bbf\u95ee\u8fdc\u7a0b\u4ed3\u5e93\uff0c\u6216\u4ed3\u5e93\u4e0d\u5b58\u5728\u3002\u90a3\u4e48\u6211\u4eec\u5c31\u9700\u8981\u68c0\u67e5\u8bbf\u95ee\u4ed3\u5e93\u7684\u6743\u9650\uff0c\u6216\u8005\u786e\u8ba4\u4ed3\u5e93\u5730\u5740\u662f\u5426\u6b63\u786e\u3002<\/p>\n<ol>\n<li>\u67e5\u770bgit log<\/li>\n<\/ol>\n<p>\u5f53git pull\u62a5\u9519\u65f6\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u901a\u8fc7\u67e5\u770bgit log\u6765\u4e86\u89e3\u4ee3\u7801\u63d0\u4ea4\u5386\u53f2\uff0c\u4ece\u800c\u627e\u5230\u95ee\u9898\u6240\u5728\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770bgit log\uff1a<\/p>\n<pre>git log<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u901a\u8fc7\u67e5\u770blog\uff0c\u6211\u4eec\u53ef\u4ee5\u4e86\u89e3\u4ee3\u7801\u63d0\u4ea4\u5386\u53f2\uff0c\u5305\u62ec\u63d0\u4ea4\u4eba\u3001\u63d0\u4ea4\u65f6\u95f4\u7b49\u4fe1\u606f\u3002\u5728\u4e86\u89e3\u4e86\u63d0\u4ea4\u5386\u53f2\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u901a\u8fc7\u56de\u6eda\u5230\u4e4b\u524d\u7684\u67d0\u4e2a\u7248\u672c\u6765\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n<ol>\n<li>\u53d6\u6d88\u672c\u5730\u4fee\u6539<\/li>\n<\/ol>\n<p>\u6709\u65f6\u5019git pull\u62a5\u9519\u7684\u539f\u56e0\u662f\u56e0\u4e3a\u672c\u5730\u5b58\u5728\u672a\u63d0\u4ea4\u7684\u4fee\u6539\u3002\u8fd9\u65f6\u5019\u6211\u4eec\u9700\u8981\u5148\u5c06\u672c\u5730\u7684\u4fee\u6539\u5168\u90e8\u64a4\u9500\uff0c\u7136\u540e\u518d\u8fdb\u884cgit pull\u3002<\/p>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u53ef\u4ee5\u64a4\u9500\u672c\u5730\u7684\u4fee\u6539\uff1a<\/p>\n<pre>git checkout -- .<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u4e2a\u547d\u4ee4\u7684\u4f5c\u7528\u662f\u64a4\u6d88\u5f53\u524d\u76ee\u5f55\u4e0b\u6240\u6709\u7684\u672a\u63d0\u4ea4\u7684\u4fee\u6539\u3002<\/p>\n<ol>\n<li>\u6e05\u7406\u7f13\u5b58<\/li>\n<\/ol>\n<p>\u5728\u4f7f\u7528Git\u65f6\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u4e00\u4e9b\u7f13\u5b58\u7684\u95ee\u9898\uff0c\u5bfc\u81f4git pull\u51fa\u73b0\u9519\u8bef\u3002\u8fd9\u65f6\u6211\u4eec\u9700\u8981\u6e05\u7406\u7f13\u5b58\uff0c\u4ee5\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\u3002<\/p>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u53ef\u4ee5\u6e05\u7406\u7f13\u5b58\uff1a<\/p>\n<pre>git rm -r --cached .<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u4e2a\u547d\u4ee4\u5c06\u5220\u9664\u672c\u5730\u7f13\u5b58\uff0c\u91cd\u65b0\u62c9\u53d6\u6570\u636e\u3002<\/p>\n<ol>\n<li>\u6dfb\u52a0\u8fdc\u7a0b\u4ed3\u5e93<\/li>\n<\/ol>\n<p>\u5982\u679cgit pull\u62a5\u9519\u7684\u539f\u56e0\u662f\u56e0\u4e3a\u672c\u5730\u7248\u672c\u5e93\u6ca1\u6709\u540c\u6b65\u8fdc\u7a0b\u7248\u672c\u5e93\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06\u8fdc\u7a0b\u7248\u672c\u5e93\u6dfb\u52a0\u5230\u672c\u5730\uff1a<\/p>\n<pre>git remote add origin https:\/\/remote_repository_url.git<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u4e2a\u547d\u4ee4\u5c06\u4f1a\u5728\u672c\u5730\u7684\u7248\u672c\u5e93\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u540d\u4e3aorigin\u7684\u8fdc\u7a0b\u4ed3\u5e93\u3002<\/p>\n<ol>\n<li>\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5<\/li>\n<\/ol>\n<p>\u6709\u65f6\u5019\uff0cgit pull\u62a5\u9519\u7684\u539f\u56e0\u5e76\u4e0d\u662f\u56e0\u4e3a\u4ee3\u7801\u51fa\u4e86\u95ee\u9898\uff0c\u800c\u662f\u56e0\u4e3a\u672c\u5730\u7f51\u7edc\u8fde\u63a5\u51fa\u4e86\u95ee\u9898\u3002\u8fd9\u65f6\u5019\u6211\u4eec\u9700\u8981\u68c0\u67e5\u672c\u5730\u7f51\u7edc\u8fde\u63a5\u662f\u5426\u6b63\u5e38\uff0c\u5c1d\u8bd5\u68c0\u67e5\u4ee3\u7406\u3001DNS\u89e3\u6790\u7b49\u95ee\u9898\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u89e3\u51b3git pull\u62a5\u9519\u95ee\u9898\u7684\u4e00\u4e9b\u65b9\u6cd5\uff0c\u5f53\u7136\uff0c\u5177\u4f53\u65b9\u6cd5\u9700\u8981\u6839\u636e\u60c5\u51b5\u5177\u4f53\u5206\u6790\u3002\u5982\u679c\u4ee5\u4e0a\u65b9\u6cd5\u90fd\u65e0\u6cd5\u89e3\u51b3\u95ee\u9898\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u901a\u8fc7\u67e5\u770bGit\u5b98\u65b9\u6587\u6863\u3001\u5411\u793e\u533a\u6c42\u52a9\u7b49\u65b9\u5f0f\u6765\u89e3\u51b3\u95ee\u9898\u3002\u5e0c\u671b\u4ee5\u4e0a\u5185\u5bb9\u80fd\u591f\u5e2e\u52a9\u5230\u5927\u5bb6\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u89e3\u51b3git pull\u62a5\u9519\u95ee\u9898\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4f7f\u7528git\u8fdb\u884c\u4ee3\u7801\u7ba1\u7406\u65f6\uff0c\u7ecf\u5e38\u4f1a\u7528\u5230git pull\u547d\u4ee4\u6765\u62c9\u53d6\u6700\u65b0\u7684\u4ee3\u7801\u3002\u4f46\u662f\uff0c\u5728\u4f7f\u7528git pull\u65f6\uff0c\u6709\u65f6\u5019\u4f1a\u9047\u5230\u62a5\u9519\u7684\u60c5\u51b5\uff0c\u5982\u4f55\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\u5462\uff1f \u672c\u6587\u5c06\u4ece\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762\u4ecb\u7ecd\u5982\u4f55\u89e3\u51b3git pull\u62a5\u9519\u95ee\u9898\uff1a \u5206\u6790\u9519\u8bef\u4fe1\u606f \u67e5\u770bgit log \u53d6\u6d88\u672c\u5730\u4fee\u6539 \u6e05\u7406\u7f13\u5b58 \u6dfb\u52a0\u8fdc\u7a0b\u4ed3\u5e93 \u68c0\u67e5\u7f51\u7edc\u8fde\u63a5 \u5206\u6790\u9519\u8bef\u4fe1\u606f \u5982\u679cgit pull\u53d1\u751f\u9519\u8bef\uff0c\u9996\u5148\u9700\u8981\u5206\u6790\u9519\u8bef\u4fe1\u606f\uff0c\u627e\u51fa\u95ee\u9898\u6240\u5728\u3002\u5728git\u62a5\u9519\u7684\u60c5\u51b5\u4e0b\uff0c\u4e00\u822c\u4f1a\u63d0\u793a\u51fa\u9519\u4fe1\u606f\uff0c\u8fd9\u65f6\u6211\u4eec\u8981\u7ed3\u5408\u8fd9\u4e2a\u4fe1\u606f\u6765\u5224\u5b9a\u95ee\u9898\u6240\u5728\uff0c\u67e5\u627e\u89e3\u51b3\u65b9\u6cd5\u3002 \u4f8b\u5982\uff1a fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u4e2a\u9519\u8bef\u4fe1\u606f\u5c31\u8868\u660e\u4e86\u6211\u4eec\u6ca1\u6709\u6743\u9650\u8bbf\u95ee\u8fdc\u7a0b\u4ed3\u5e93\uff0c\u6216\u4ed3\u5e93\u4e0d\u5b58\u5728\u3002\u90a3\u4e48\u6211\u4eec\u5c31\u9700\u8981\u68c0\u67e5\u8bbf\u95ee\u4ed3\u5e93\u7684\u6743\u9650\uff0c\u6216\u8005\u786e\u8ba4\u4ed3\u5e93\u5730\u5740\u662f\u5426\u6b63\u786e\u3002 \u67e5\u770bgit log \u5f53git pull\u62a5\u9519\u65f6\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u901a\u8fc7\u67e5\u770bgit log\u6765\u4e86\u89e3\u4ee3\u7801\u63d0\u4ea4\u5386\u53f2\uff0c\u4ece\u800c\u627e\u5230\u95ee\u9898\u6240\u5728\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770bgit log\uff1a git log \u767b\u5f55\u540e\u590d\u5236 \u901a\u8fc7\u67e5\u770blog\uff0c\u6211\u4eec\u53ef\u4ee5\u4e86\u89e3\u4ee3\u7801\u63d0\u4ea4\u5386\u53f2\uff0c\u5305\u62ec\u63d0\u4ea4\u4eba\u3001\u63d0\u4ea4\u65f6\u95f4\u7b49\u4fe1\u606f\u3002\u5728\u4e86\u89e3\u4e86\u63d0\u4ea4\u5386\u53f2\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u901a\u8fc7\u56de\u6eda\u5230\u4e4b\u524d\u7684\u67d0\u4e2a\u7248\u672c\u6765\u89e3\u51b3\u95ee\u9898\u3002 \u53d6\u6d88\u672c\u5730\u4fee\u6539 \u6709\u65f6\u5019git pull\u62a5\u9519\u7684\u539f\u56e0\u662f\u56e0\u4e3a\u672c\u5730\u5b58\u5728\u672a\u63d0\u4ea4\u7684\u4fee\u6539\u3002\u8fd9\u65f6\u5019\u6211\u4eec\u9700\u8981\u5148\u5c06\u672c\u5730\u7684\u4fee\u6539\u5168\u90e8\u64a4\u9500\uff0c\u7136\u540e\u518d\u8fdb\u884cgit pull\u3002 \u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u53ef\u4ee5\u64a4\u9500\u672c\u5730\u7684\u4fee\u6539\uff1a git checkout [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-19577","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19577","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=19577"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19577\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19577"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19577"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}