{"id":157334,"date":"2019-09-13T08:17:55","date_gmt":"2019-09-13T00:17:55","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=157334"},"modified":"2019-08-27T14:28:49","modified_gmt":"2019-08-27T06:28:49","slug":"git-extract-remote","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/git-extract-remote.html","title":{"rendered":"\u6559\u4f60\u73a9\u8f6cGit-\u63d0\u53d6\u8fdc\u7a0b\u4ed3\u5e93"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nGit \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u7528\u4e8e\u654f\u6377\u9ad8\u6548\u5730\u5904\u7406\u4efb\u4f55\u6216\u5c0f\u6216\u5927\u7684\u9879\u76ee\u3002Git \u662f Linus Torvalds \u4e3a\u4e86\u5e2e\u52a9\u7ba1\u7406 Linux \u5185\u6838\u5f00\u53d1\u800c\u5f00\u53d1\u7684\u4e00\u4e2a\u5f00\u653e\u6e90\u7801\u7684\u7248\u672c\u63a7\u5236\u8f6f\u4ef6\u3002Git \u4e0e\u5e38\u7528\u7684\u7248\u672c\u63a7\u5236\u5de5\u5177 CVS, Subversion \u7b49\u4e0d\u540c\uff0c\u5b83\u91c7\u7528\u4e86\u5206\u5e03\u5f0f\u7248\u672c\u5e93\u7684\u65b9\u5f0f\uff0c\u4e0d\u5fc5\u670d\u52a1\u5668\u7aef\u8f6f\u4ef6\u652f\u6301\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"
\nGit \u6709\u4e24\u4e2a\u547d\u4ee4\u7528\u6765\u63d0\u53d6\u8fdc\u7a0b\u4ed3\u5e93\u7684\u66f4\u65b0\u3002<\/p>\n

1\u3001\u4ece\u8fdc\u7a0b\u4ed3\u5e93\u4e0b\u8f7d\u65b0\u5206\u652f\u4e0e\u6570\u636e\uff1a<\/p>\n

git fetch<\/pre>\n

\u8be5\u547d\u4ee4\u6267\u884c\u5b8c\u540e\u9700\u8981\u6267\u884cgit merge \u8fdc\u7a0b\u5206\u652f\u5230\u4f60\u6240\u5728\u7684\u5206\u652f\u3002<\/p>\n

2\u3001\u4ece\u8fdc\u7aef\u4ed3\u5e93\u63d0\u53d6\u6570\u636e\u5e76\u5c1d\u8bd5\u5408\u5e76\u5230\u5f53\u524d\u5206\u652f\uff1a<\/p>\n

git merge<\/pre>\n

\u8be5\u547d\u4ee4\u5c31\u662f\u5728\u6267\u884c git fetch \u4e4b\u540e\u7d27\u63a5\u7740\u6267\u884c git merge \u8fdc\u7a0b\u5206\u652f\u5230\u4f60\u6240\u5728\u7684\u4efb\u610f\u5206\u652f\u3002<\/p>\n

\u5047\u8bbe\u4f60\u914d\u7f6e\u597d\u4e86\u4e00\u4e2a\u8fdc\u7a0b\u4ed3\u5e93\uff0c\u5e76\u4e14\u4f60\u60f3\u8981\u63d0\u53d6\u66f4\u65b0\u7684\u6570\u636e\uff0c\u4f60\u53ef\u4ee5\u9996\u5148\u6267\u884c git fetch [alias] \u544a\u8bc9 Git \u53bb\u83b7\u53d6\u5b83\u6709\u4f60\u6ca1\u6709\u7684\u6570\u636e\uff0c\u7136\u540e\u4f60\u53ef\u4ee5\u6267\u884c git merge [alias]\/[branch] \u4ee5\u5c06\u670d\u52a1\u5668\u4e0a\u7684\u4efb\u4f55\u66f4\u65b0\uff08\u5047\u8bbe\u6709\u4eba\u8fd9\u65f6\u5019\u63a8\u9001\u5230\u670d\u52a1\u5668\u4e86\uff09\u5408\u5e76\u5230\u4f60\u7684\u5f53\u524d\u5206\u652f\u3002<\/p>\n

\u63a5\u4e0b\u6765\u6211\u4eec\u5728 Github \u4e0a\u70b9\u51fb\" README.md\" \u5e76\u5728\u7ebf\u4fee\u6539\u5b83:
\n\"\"
\n\u7136\u540e\u6211\u4eec\u5728\u672c\u5730\u66f4\u65b0\u4fee\u6539\u3002<\/p>\n

$ git fetch origin\r\nremote: Counting objects: 3, done.\r\nremote: Compressing objects: 100% (2\/2), done.\r\nremote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0\r\nUnpacking objects: 100% (3\/3), done.\r\nFrom github.com:tianqixin\/runoob-git-test\r\n   0205aab..febd8ed  master     -> origin\/master<\/pre>\n

\u4ee5\u4e0a\u4fe1\u606f\"0205aab..febd8ed master -> origin\/master\" \u8bf4\u660e master \u5206\u652f\u5df2\u88ab\u66f4\u65b0\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06\u66f4\u65b0\u540c\u6b65\u5230\u672c\u5730\uff1a<\/p>\n

$ git merge origin\/master\r\nUpdating 0205aab..febd8ed\r\nFast-forward\r\n README.md | 1 +\r\n 1 file changed, 1 insertion(+)<\/pre>\n

\u67e5\u770b README.md \u6587\u4ef6\u5185\u5bb9\uff1a<\/p>\n

$ cat README.md \r\n# \u83dc\u9e1f\u6559\u7a0b Git \u6d4b\u8bd5\r\n## \u7b2c\u4e00\u6b21\u4fee\u6539\u5185\u5bb9<\/pre>\n","protected":false},"excerpt":{"rendered":"

Git \u6709\u4e24\u4e2a\u547d\u4ee4\u7528\u6765\u63d0\u53d6\u8fdc\u7a0b\u4ed3\u5e93\u7684\u66f4\u65b0\u3002 1\u3001\u4ece\u8fdc\u7a0b\u4ed3\u5e93\u4e0b\u8f7d\u65b0\u5206\u652f\u4e0e\u6570\u636e\uff1a git fetch \u8be5\u547d\u4ee4\u6267\u884c\u5b8c […]<\/p>\n","protected":false},"author":321,"featured_media":157324,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-157334","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/157334","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/321"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=157334"}],"version-history":[{"count":1,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/157334\/revisions"}],"predecessor-version":[{"id":157340,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/157334\/revisions\/157340"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/157324"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=157334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=157334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=157334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}