{"id":19124,"date":"2024-11-19T14:27:15","date_gmt":"2024-11-19T06:27:15","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19124\/"},"modified":"2024-11-19T14:27:15","modified_gmt":"2024-11-19T06:27:15","slug":"git-%e5%a6%82%e4%bd%95-fork","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19124\/","title":{"rendered":"git \u5982\u4f55 fork"},"content":{"rendered":"<p>\u4e00\u3001\u4ec0\u4e48\u662f git fork\uff1f<\/p>\n<p>Git Fork\uff08\u5206\u53c9\uff09\u662f\u6307\u5c06\u539f\u6709\u9879\u76ee\u7684\u4ed3\u5e93\u590d\u5236\u4e00\u4efd\u5230\u81ea\u5df1\u7684 GitHub \u8d26\u6237\u4e0b\uff0c\u4ece\u800c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u4ed3\u5e93\u3002\u901a\u8fc7 Fork\uff0c\u4f60\u53ef\u4ee5\u5c06\u522b\u4eba\u7684\u9879\u76ee\u590d\u5236\u5230\u81ea\u5df1\u7684\u8d26\u6237\u4e0b\u8fdb\u884c\u4fee\u6539\u3001\u53d1\u5e03\u3001\u5206\u4eab\u7b49\u64cd\u4f5c\uff0c\u800c\u4e14\u8fd9\u4e2a\u65b0\u7684\u4ed3\u5e93\u548c\u539f\u6709\u9879\u76ee\u62e5\u6709\u540c\u6837\u7684\u4ee3\u7801\u548c\u63d0\u4ea4\u8bb0\u5f55\u3002<\/p>\n<p>\u4e8c\u3001\u600e\u6837 Fork \u4e00\u4e2a\u4ed3\u5e93\uff1f<\/p>\n<ol>\n<li>\u767b\u5f55\u81ea\u5df1\u7684 GitHub \u8d26\u6237<br \/>\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165 https:\/\/github.com \u5e76\u767b\u5f55\u3002<\/li>\n<li>\u627e\u5230\u9700\u8981 Fork \u7684\u4ed3\u5e93<br \/>\u627e\u5230\u60f3\u8981 Fork \u7684\u4ed3\u5e93\uff0c\u4f8b\u5982 https:\/\/github.com\/octocat\/Spoon-Knife \u3002<\/li>\n<li>Fork \u4ed3\u5e93<br \/>\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684 Fork \u6309\u94ae\uff0c\u5c06\u8be5\u4ed3\u5e93 Fork \u5230\u81ea\u5df1\u7684\u8d26\u6237\u4e0b\u3002<\/li>\n<li>\u7b49\u5f85 Fork \u5b8c\u6210<br \/>\u5728 Fork \u5b8c\u6210\u4e4b\u524d\uff0c\u9875\u9762\u4f1a\u4e00\u76f4\u663e\u793a\u201cForking\u201d\u5b57\u6837\u3002<\/li>\n<\/ol>\n<p>\u4e09\u3001\u5982\u4f55\u5c06 Fork \u540e\u7684\u4ed3\u5e93\u540c\u6b65\u66f4\u65b0\u5230\u539f\u6709\u4ed3\u5e93\uff1f<\/p>\n<p>\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u4f60 Fork \u7684\u4e00\u4e2a\u9879\u76ee\u90fd\u662f\u57fa\u4e8e\u4e3b\u5f00\u53d1\u8005\u7684\u9879\u76ee\uff0c\u6240\u4ee5\u4e00\u6bb5\u65f6\u95f4\u540e\uff0c\u539f\u6709\u7684\u9879\u76ee\u4f1a\u4e0d\u65ad\u66f4\u65b0\uff0c\u800c\u4f60\u7684 Fork \u9879\u76ee\u5e76\u4e0d\u4f1a\u81ea\u52a8\u540c\u6b65\u8fd9\u4e9b\u66f4\u65b0\u5185\u5bb9\uff0c\u56e0\u6b64\uff0c\u9700\u8981\u624b\u52a8\u5c06\u539f\u6709\u9879\u76ee\u4fee\u6539\u540c\u6b65\u5230\u81ea\u5df1\u7684 Fork \u9879\u76ee\u5185\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f\u540c\u6b65 Fork \u4ed3\u5e93\u65b9\u6cd5\uff1a<\/p>\n<ol>\n<li>Clone Fork \u9879\u76ee<br \/>\u8fdb\u5165 your_repo \u9875\u9762\uff0c\u70b9\u51fb\u201cClone or download\u201d\uff0c\u5c06\u5176 Clone \u5230\u672c\u5730\u3002<\/li>\n<li>\u6dfb\u52a0\u8fdc\u7a0b\u4ed3\u5e93<br \/>\u5728\u672c\u5730\u514b\u9686\u7684 Fork \u9879\u76ee\u4e0b\uff0c\u6267\u884c\u547d\u4ee4\uff1agit remote add upstream \u4e3b\u5f00\u53d1\u8005\u9879\u76ee\u7684\u5730\u5740<br \/>\u4f8b\u5982\uff1agit remote add upstream https:\/\/github.com\/octocat\/Spoon-Knife.git<\/li>\n<li>\u62c9\u53d6\u4e3b\u5f00\u53d1\u8005\u7684\u63d0\u4ea4\u8bb0\u5f55<br \/>\u6267\u884c\u547d\u4ee4\uff1agit fetch upstream<\/li>\n<li>\u5207\u6362\u5206\u652f\u5e76\u5408\u5e76\u4e3b\u5f00\u53d1\u8005\u7684\u66f4\u65b0<br \/>\u6267\u884c\u547d\u4ee4\uff1agit checkout master<br \/>\u6267\u884c\u547d\u4ee4\uff1agit merge upstream\/master<\/li>\n<li>Push \u5230\u4e2a\u4eba\u8d26\u6237\u4e0b\u7684 Fork \u4ed3\u5e93<br \/>\u6267\u884c\u547d\u4ee4\uff1agit push origin master<\/li>\n<\/ol>\n<p>\u4ee5\u4e0a\u64cd\u4f5c\u5b8c\u6210\u540e\uff0c\u4f60\u7684 Fork \u4ed3\u5e93\u4fbf\u5df2\u66f4\u65b0\u5230\u6700\u65b0\u7684\u72b6\u6001\u3002<\/p>\n<p>\u56db\u3001\u5982\u4f55\u7ba1\u7406\u81ea\u5df1\u7684 Fork \u4ed3\u5e93\uff1f<\/p>\n<p>\u5728 GitHub \u4e0a\uff0c\u4f60\u53ef\u4ee5\u8f7b\u677e\u7ba1\u7406\u81ea\u5df1\u7684 Fork \u4ed3\u5e93\uff0c\u4ee5\u4e0b\u662f\u51e0\u4e2a\u7b80\u5355\u7684\u64cd\u4f5c\uff1a<\/p>\n<ol>\n<li>Clone Fork \u9879\u76ee<br \/>\u4e0e\u4e0a\u4e00\u6b65\u76f8\u540c\uff0c\u5c06 Fork \u9879\u76ee Clone \u5230\u672c\u5730\u3002<\/li>\n<li>\u6dfb\u52a0\u4e0a\u6e38\u4ed3\u5e93\u548c\u540c\u6b65\u66f4\u65b0<br \/>\u53c2\u8003\u4e0a\u4e00\u6b65\u6240\u63cf\u8ff0\u7684\u64cd\u4f5c\uff0c\u5c06\u539f\u6709\u9879\u76ee\u7684\u5730\u5740\u6dfb\u52a0\u5230\u81ea\u5df1\u7684 Fork \u9879\u76ee\u5185\uff0c\u5e76\u540c\u6b65\u66f4\u65b0\u3002<\/li>\n<li>Pull Request \u5408\u5e76<br \/>\u5f53\u4f60 Fork \u9879\u76ee\u7684\u5185\u5bb9\u6709\u91cd\u5927\u6539\u8fdb\u6216\u4fee\u590d\u95ee\u9898\u65f6\uff0c\u53ef\u4ee5\u63d0\u51fa Pull Request\uff0c\u8bf7\u6c42\u4e3b\u5f00\u53d1\u8005\u5408\u5e76\u4f60\u7684\u4fee\u6539\u3002<\/li>\n<\/ol>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u64cd\u4f5c\uff0c\u4f60\u53ef\u4ee5\u8f7b\u677e\u7ba1\u7406 Fork \u4ed3\u5e93\uff0c\u8fdb\u884c\u4fee\u6539\u3001\u63a8\u9001\u3001\u540c\u6b65\u66f4\u65b0\u4ee5\u53ca\u63d0\u4ea4 Pull Request \u7b49\u64cd\u4f5c\u3002<\/p>\n<p>\u4e94\u3001\u603b\u7ed3<\/p>\n<p>\u901a\u8fc7\u672c\u6587\uff0c\u6211\u4eec\u8be6\u7ec6\u638c\u63e1\u4e86\u5982\u4f55 Fork \u4e00\u4e2a\u9879\u76ee\uff0c\u5982\u4f55\u540c\u6b65\u66f4\u65b0 Fork \u9879\u76ee\uff0c\u4ee5\u53ca\u5982\u4f55\u7ba1\u7406\u81ea\u5df1\u7684 Fork \u4ed3\u5e93\u3002\u4f5c\u4e3a\u4e00\u540d Git \u4f7f\u7528\u8005\uff0c\u9664\u4e86\u638c\u63e1 Fork \u7684\u6280\u80fd\uff0c\u8fd8\u5e94\u8be5\u6df1\u5165\u638c\u63e1 Git \u7684\u5176\u4ed6\u64cd\u4f5c\u6280\u5de7\uff0c\u4ee5\u5e2e\u52a9\u6211\u4eec\u66f4\u597d\u5730\u7ba1\u7406\u9879\u76ee\u3001\u63d0\u9ad8\u6548\u7387\u548c\u534f\u540c\u5f00\u53d1\u80fd\u529b\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fgit \u5982\u4f55 fork\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>\u4e00\u3001\u4ec0\u4e48\u662f git fork\uff1f Git Fork\uff08\u5206\u53c9\uff09\u662f\u6307\u5c06\u539f\u6709\u9879\u76ee\u7684\u4ed3\u5e93\u590d\u5236\u4e00\u4efd\u5230\u81ea\u5df1\u7684 GitHub \u8d26\u6237\u4e0b\uff0c\u4ece\u800c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u4ed3\u5e93\u3002\u901a\u8fc7 Fork\uff0c\u4f60\u53ef\u4ee5\u5c06\u522b\u4eba\u7684\u9879\u76ee\u590d\u5236\u5230\u81ea\u5df1\u7684\u8d26\u6237\u4e0b\u8fdb\u884c\u4fee\u6539\u3001\u53d1\u5e03\u3001\u5206\u4eab\u7b49\u64cd\u4f5c\uff0c\u800c\u4e14\u8fd9\u4e2a\u65b0\u7684\u4ed3\u5e93\u548c\u539f\u6709\u9879\u76ee\u62e5\u6709\u540c\u6837\u7684\u4ee3\u7801\u548c\u63d0\u4ea4\u8bb0\u5f55\u3002 \u4e8c\u3001\u600e\u6837 Fork \u4e00\u4e2a\u4ed3\u5e93\uff1f \u767b\u5f55\u81ea\u5df1\u7684 GitHub \u8d26\u6237\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165 https:\/\/github.com \u5e76\u767b\u5f55\u3002 \u627e\u5230\u9700\u8981 Fork \u7684\u4ed3\u5e93\u627e\u5230\u60f3\u8981 Fork \u7684\u4ed3\u5e93\uff0c\u4f8b\u5982 https:\/\/github.com\/octocat\/Spoon-Knife \u3002 Fork \u4ed3\u5e93\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684 Fork \u6309\u94ae\uff0c\u5c06\u8be5\u4ed3\u5e93 Fork \u5230\u81ea\u5df1\u7684\u8d26\u6237\u4e0b\u3002 \u7b49\u5f85 Fork \u5b8c\u6210\u5728 Fork \u5b8c\u6210\u4e4b\u524d\uff0c\u9875\u9762\u4f1a\u4e00\u76f4\u663e\u793a\u201cForking\u201d\u5b57\u6837\u3002 \u4e09\u3001\u5982\u4f55\u5c06 Fork \u540e\u7684\u4ed3\u5e93\u540c\u6b65\u66f4\u65b0\u5230\u539f\u6709\u4ed3\u5e93\uff1f \u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u4f60 Fork \u7684\u4e00\u4e2a\u9879\u76ee\u90fd\u662f\u57fa\u4e8e\u4e3b\u5f00\u53d1\u8005\u7684\u9879\u76ee\uff0c\u6240\u4ee5\u4e00\u6bb5\u65f6\u95f4\u540e\uff0c\u539f\u6709\u7684\u9879\u76ee\u4f1a\u4e0d\u65ad\u66f4\u65b0\uff0c\u800c\u4f60\u7684 Fork \u9879\u76ee\u5e76\u4e0d\u4f1a\u81ea\u52a8\u540c\u6b65\u8fd9\u4e9b\u66f4\u65b0\u5185\u5bb9\uff0c\u56e0\u6b64\uff0c\u9700\u8981\u624b\u52a8\u5c06\u539f\u6709\u9879\u76ee\u4fee\u6539\u540c\u6b65\u5230\u81ea\u5df1\u7684 Fork \u9879\u76ee\u5185\u3002 \u4ee5\u4e0b\u662f\u540c\u6b65 Fork \u4ed3\u5e93\u65b9\u6cd5\uff1a Clone Fork \u9879\u76ee\u8fdb\u5165 your_repo \u9875\u9762\uff0c\u70b9\u51fb\u201cClone or download\u201d\uff0c\u5c06\u5176 Clone [&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-19124","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19124","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=19124"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19124\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}