{"id":111496,"date":"2024-12-16T22:42:10","date_gmt":"2024-12-16T14:42:10","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=111496"},"modified":"2024-12-16T22:42:10","modified_gmt":"2024-12-16T14:42:10","slug":"git-2-18-git-v2","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/git-2-18-git-v2.html","title":{"rendered":"Git 2.18\u7248\u672c\u53d1\u5e03\uff1a\u652f\u6301Git\u534f\u8baev2\uff0c\u63d0\u5347\u6027\u80fd"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5728\u6700\u65b0\u7684\u5b98\u65b9 Git \u5ba2\u6237\u7aef\u6b63\u5f0f\u72482.18\u4e2d\u6dfb\u52a0\u4e86\u5bf9 Git wire \u534f\u8bae v2 \u7684\u652f\u6301\uff0c\u5e76\u5f15\u5165\u4e86\u4e00\u4e9b\u6027\u80fd\u4e0e UI \u6539\u8fdb\u7684\u65b0\u7279\u6027\u3002\u5728 Git \u7684\u6838\u5fc3\u56e2\u961f\u6210\u5458 Brandon Williams \u516c\u5f00\u5ba3\u5e03\u8fd9\u4e00\u6d88\u606f\u524d\u51e0\u5468\uff0cGit \u534f\u8bae v2 \u521a\u521a\u5408\u5e76\u81f3 Git \u7684 master \u4e3b\u5e72\u5206\u652f\u3002Git wire \u534f\u8bae\u5b9a\u4e49\u4e86 Git \u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u7aef\u5982\u4f55\u5bf9\u4e8e clone\u3001fetch \u548c push \u7b49\u64cd\u4f5c\u8fdb\u884c\u901a\u4fe1\u3002\u6309 Williams \u6240\u8bf4\uff0c\u65b0\u7248\u672c\u534f\u8bae\u7684\u76ee\u6807\u662f\u63d0\u5347\u6027\u80fd\uff0c\u5e76\u4f7f\u5176\u80fd\u591f\u66f4\u597d\u7684\u9002\u5e94\u672a\u6765\u7684\u6539\u8fdb\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

\u65b0\u7248\u672c\u534f\u8bae\u7684\u4e3b\u8981\u9a71\u52a8\u529b\u662f\u4f7f Git \u670d\u52a1\u7aef\u80fd\u591f\u5bf9\u5404\u79cd ref\uff08\u5206\u652f\u4e0e tag\uff09\u8fdb\u884c\u8fc7\u6ee4\u64cd\u4f5c\u3002<\/p>\n

\u8fd9\u5c31\u610f\u5473\u7740\uff0cGit \u670d\u52a1\u5668\u65e0\u9700\u5c06\u4ee3\u7801\u5e93\u4e2d\u6240\u6709\u7684 ref \u4e00\u6b21\u6027\u53d1\u9001\u7ed9\u5ba2\u6237\u7aef\uff0c\u518d\u7531\u5ba2\u6237\u7aef\u8fdb\u884c\u8fc7\u6ee4\u3002\u5728\u5927\u578b\u7684\u4ee3\u7801\u5e93\u4e2d\u53ef\u80fd\u4f1a\u5b58\u5728\u4e0d\u8ba1\u5176\u6570\u7684 ref\uff0c\u5373\u4f7f\u67d0\u4e9b ref \u662f\u5ba2\u6237\u7aef\u65e0\u9700\u4f7f\u7528\u7684\uff0c\u4e5f\u4e0d\u5f97\u4e0d\u52a0\u8f7d\u591a\u8fbe\u6570\u4e2a MB \u7684 ref \u6570\u636e\u3002\u5728\u4f7f\u7528 v2 \u534f\u8bae\u4e4b\u540e\uff0cGit \u670d\u52a1\u5668\u5c06\u6839\u636e\u5ba2\u6237\u7aef\u6240\u9700\u7684\u64cd\u4f5c\u7c7b\u578b\uff0c\u5bf9 ref \u8fdb\u884c\u8fc7\u6ee4\u4e4b\u540e\u518d\u5c06\u5217\u8868\u53d1\u9001\u81f3\u5ba2\u6237\u7aef\u3002Williams \u4e3e\u4e86\u4e00\u4e2a\u4f8b\u5b50\uff0c\u5982\u679c\u5f00\u53d1\u8005\u6240\u66f4\u65b0\u7684\u5206\u652f\u4ec5\u6bd4\u5176\u8fdc\u7a0b\u5206\u652f\u843d\u540e\u51e0\u4e2a\u63d0\u4ea4\uff0c\u6216\u662f\u4ec5\u4ec5\u68c0\u67e5\u672c\u5730\u5206\u652f\u662f\u5426\u5df2\u66f4\u65b0\uff0c\u5219\u5b8c\u5168\u6ca1\u6709\u5fc5\u8981\u5728\u670d\u52a1\u7aef\u4f20\u9012\u6574\u4e2a ref \u5217\u8868\uff0c\u8fd9\u5bf9\u4e8e\u65f6\u95f4\u548c\u5e26\u5bbd\u90fd\u662f\u4e00\u79cd\u6d6a\u8d39\u3002Williams \u8868\u793a\uff0c\u57fa\u4e8e Google \u5185\u90e8\u5bf9\u534f\u8bae v2\u7684\u4f7f\u7528\uff0c\u5728\u8bbf\u95ee\u4f8b\u5982 Chrome \u8fd9\u79cd\u5305\u542b\u4e86\u8d85\u8fc750\u4e07\u4e2a\u5206\u652f\u548c tag \u7684\u5927\u578b\u4ed3\u5e93\u65f6\uff0c\u6bd4\u8d77\u4f7f\u7528 v1 \u534f\u8bae\u53ef\u8fbe\u5230\u4e09\u500d\u901f\u4ee5\u4e0a\u3002\u6b64\u5916\uff0c\u901a\u8fc7\u4f7f\u7528\u65b0\u7248\u672c\u534f\u8bae\uff0c\u66f4\u4fbf\u4e8e\u5b9e\u73b0\u67d0\u4e9b\u65b0\u7684\u7279\u6027\uff0c\u4f8b\u5982\u6309\u9700\u9009\u53d6 ref\uff0c\u4ee5\u53ca\u62c9\u53d6\u548c\u63a8\u9001 symref \u7b49\u7b49\u3002<\/p>\n

\u652f\u6301\u534f\u8bae v2 \u7684 Git \u5ba2\u6237\u7aef\u4ecd\u7136\u53ef\u4ee5\u4e0e\u5c1a\u672a\u652f\u6301 v2 \u7684\u65e7\u7248\u672c\u670d\u52a1\u7aef\u8fdb\u884c\u901a\u4fe1\u3002\u8fd9\u8981\u611f\u8c22\u5f53\u521d\u5728\u8bbe\u8ba1\u65f6\u51b3\u5b9a\u901a\u8fc7\u4e00\u4e2a\u72ec\u7acb\u7684\u901a\u9053\u53d1\u9001 v2 \u6240\u5fc5\u987b\u7684\u989d\u5916\u4fe1\u606f\u3002\u65e7\u7248\u672c\u7684\u670d\u52a1\u7aef\u4f1a\u76f4\u63a5\u5ffd\u7565\u8fd9\u4e2a\u989d\u5916\u7684\u901a\u9053\uff0c\u5e76\u8fd4\u56de ref \u7684\u5b8c\u6574\u5217\u8868\u3002<\/p>\n

\u4e3a\u4e86\u8ba9\u5f00\u53d1\u8005\u80fd\u591f\u81ea\u884c\u9009\u62e9\u534f\u8bae\u7684\u7248\u672c\uff0cGit \u73b0\u5728\u6dfb\u52a0\u4e86\u4e00\u4e2a\u65b0\u7684 -c \u547d\u4ee4\u884c\u9009\u9879\uff0c\u5982\u4ee5\u4e0b\u793a\u4f8b\uff1a<\/p>\n

git -c protocol.version=2 ls-remote<\/pre>\n

\u5982\u679c\u5e0c\u671b\u9ed8\u8ba4\u4f7f\u7528 v2 \u534f\u8bae\uff0c\u53ef\u4ee5\u4fee\u6539 Git \u7684\u914d\u7f6e\uff1a<\/p>\n

git config --global protocol.version=2<\/pre>\n

Git 2.18 \u4e2d\u7684\u53e6\u4e00\u4e2a\u65b0\u7279\u6027\u662f\u901a\u8fc7\u5e8f\u5217\u5316\u7684 commit graph \u6539\u5584\u6027\u80fd\u3002\u7b80\u5355\u6765\u8bf4\uff0c\u5c31\u662f\u65b0\u7248\u672c\u7684 Git \u53ef\u4ee5\u5c06 commit graph \u7684\u7ed3\u6784\u4fdd\u5b58\u5728\u67d0\u4e2a\u6587\u4ef6\u4e2d\uff0c\u5e76\u9644\u52a0\u4e00\u4e9b\u989d\u5916\u7684\u5143\u6570\u636e\uff0c\u4ee5\u52a0\u901f\u56fe\u5f62\u7684\u52a0\u8f7d\u3002\u5728\u8fdb\u884c\u83b7\u53d6\u5217\u8868\uff0c\u5bf9\u63d0\u4ea4\u5386\u53f2\u8fdb\u884c\u8fc7\u6ee4\uff0c\u4ee5\u53ca\u8ba1\u7b97\u5408\u5e76\u7684 base \u7b49\u64cd\u4f5c\u65f6\uff0c\u4f1a\u8868\u73b0\u5f97\u975e\u5e38\u9ad8\u6548\u3002\u8fd9\u9879\u529f\u80fd\u662f\u7531\u5fae\u8f6f\u7684\u56e2\u961f\u6240\u5b9e\u73b0\u7684\uff0c\u8be5\u56e2\u961f\u7684\u6210\u5458 Derrick Stole \u8868\u793a\uff0c\u5bf9\u4e8e\u5927\u578b\u4ee3\u7801\u5e93\uff0c\u4f8b\u5982 Linux kernel \u6216 Git \u672c\u8eab\u7684\u4ee3\u7801\u5e93\u8fdb\u884c\u8fd9\u7c7b\u64cd\u4f5c\u65f6\uff0c\u901f\u5ea6\u53ef\u63d0\u5347 75\u201399%\u3002Git \u7684 commit graph \u4ecd\u7136\u662f\u4e00\u9879\u5904\u4e8e\u5b9e\u9a8c\u6027\u9636\u6bb5\u7684\u529f\u80fd\uff0c\u56e0\u4e3a\u67d0\u4e9b Git \u7279\u6027\u65e0\u6cd5\u5f88\u597d\u5730\u4e0e commit graph \u76f8\u914d\u5408\uff0c\u4f8b\u5982\u6d45\u514b\u9686\u3001\u5bf9\u8c61\u66ff\u6362\uff0c\u4ee5\u53ca commit graft \u7b49\u7b49\u3002\u5982\u679c\u4e0d\u6253\u7b97\u4f7f\u7528\u8fd9\u4e9b\u7279\u6027\uff0c\u53ef\u4ee5\u901a\u8fc7\u8fd0\u884c git config core.commitGraph true \u547d\u4ee4\u542f\u7528 commit graph\u3002<\/p>\n

\u8bfb\u8005\u53ef\u5728\u5b98\u65b9\u53d1\u5e03\u8bf4\u660e<\/a>\u4e2d\u4e86\u89e3 Git 2.18 \u7684\u5b8c\u6574\u7279\u6027\u3002<\/p>\n

\u67e5\u770b\u82f1\u6587\u539f\u6587\uff1aGit 2.18 Adds Support for Git Protocol Version 2<\/a><\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/www.linuxidc.com\/Linux\/2018-07\/153075.htm<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttps:\/\/lrxjmw.cn\/git-2-18-git-v2.html<\/a>\u7f16\u8f91\uff1a\u5468\u6653\u96ea\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb \u5728\u6700\u65b0\u7684\u5b98\u65b9 Git \u5ba2\u6237\u7aef\u6b63\u5f0f\u72482.18\u4e2d\u6dfb\u52a0\u4e86\u5bf9 Git wire \u534f\u8bae v2 \u7684\u652f\u6301\uff0c\u5e76\u5f15\u5165\u4e86\u4e00\u4e9b […]<\/p>\n","protected":false},"author":63,"featured_media":111499,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[21],"tags":[],"class_list":["post-111496","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/111496","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\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=111496"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/111496\/revisions"}],"predecessor-version":[{"id":111599,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/111496\/revisions\/111599"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/111499"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=111496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=111496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=111496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}