{"id":18741,"date":"2024-11-19T14:43:27","date_gmt":"2024-11-19T06:43:27","guid":{"rendered":"https:\/\/fwq.ai\/blog\/18741\/"},"modified":"2024-11-19T14:43:27","modified_gmt":"2024-11-19T06:43:27","slug":"%e6%b5%85%e6%9e%90%e4%bd%bf%e7%94%a8github%e7%9a%84%e5%9f%ba%e6%9c%ac%e6%93%8d%e4%bd%9c%e6%b5%81%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/18741\/","title":{"rendered":"\u6d45\u6790\u4f7f\u7528Github\u7684\u57fa\u672c\u64cd\u4f5c\u6d41\u7a0b"},"content":{"rendered":"<p>\u5728\u4f7f\u7528 github \u7684\u65f6\u5019\uff0c\u9700\u8981\u5148\u5b89\u88c5 git \u5de5\u5177\uff0c\u518d\u914d\u7f6e github \u8d26\u6237\uff0c\u7136\u540e\u624d\u80fd\u4e0a\u4f20\u4ee3\u7801\u5230 github \u4e0a\u9762\u3002\u4e0b\u9762\u5c31\u662f\u5177\u4f53\u7684\u64cd\u4f5c\u6b65\u9aa4\uff1a<\/p>\n<ol>\n<li>\u5b89\u88c5 Git \u5de5\u5177<\/li>\n<\/ol>\n<p>\u9996\u5148\u9700\u8981\u5728\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5 Git \u5de5\u5177\u3002\u5728 Windows \u64cd\u4f5c\u7cfb\u7edf\u4e0a\uff0c\u53ef\u4ee5\u4e0a Git \u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u7a0b\u5e8f\uff1b\u5728 Linux \u6216\u8005 macOS \u4e0a\uff0c\u53ef\u4ee5\u4f7f\u7528\u7cfb\u7edf\u81ea\u5e26\u7684\u5305\u7ba1\u7406\u5668\u5b89\u88c5 Git\u3002<\/p>\n<ol>\n<li>\u521b\u5efa Github \u8d26\u6237<\/li>\n<\/ol>\n<p>\u5982\u679c\u8fd8\u6ca1\u6709 Github \u8d26\u6237\uff0c\u9700\u8981\u5148\u6ce8\u518c\u4e00\u4e2a\u8d26\u6237\u3002\u5728\u6ce8\u518c\u8fc7\u7a0b\u4e2d\u9700\u8981\u586b\u5199\u7528\u6237\u540d\u3001\u7535\u5b50\u90ae\u4ef6\u5730\u5740\u548c\u5bc6\u7801\u7b49\u4fe1\u606f\u3002<\/p>\n<ol>\n<li>\u521b\u5efa\u65b0\u9879\u76ee<\/li>\n<\/ol>\n<p>\u5728 Github \u754c\u9762\u4e0a\uff0c\u70b9\u51fb &#8220;New repository&#8221; \u6309\u94ae\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9879\u76ee\u3002<\/p>\n<ol>\n<li>\u514b\u9686\u9879\u76ee<\/li>\n<\/ol>\n<p>\u5728\u672c\u5730\u8ba1\u7b97\u673a\u4e0a\uff0c\u4f7f\u7528 Git \u5de5\u5177\u901a\u8fc7\u547d\u4ee4\u884c\u514b\u9686 Github \u4e0a\u7684\u9879\u76ee\u4ee3\u7801\u5230\u672c\u5730\u3002<\/p>\n<p>$ git clone git@github.com:username\/projectname.git<\/p>\n<p>\u5176\u4e2d\uff0cusername \u662f Github \u8d26\u6237\u540d\uff0cprojectname \u662f\u9879\u76ee\u540d\u79f0\u3002<\/p>\n<ol>\n<li>\u4fee\u6539\u4ee3\u7801<\/li>\n<\/ol>\n<p>\u5728\u672c\u5730\u7535\u8111\u4e0a\u4fee\u6539\u9879\u76ee\u4ee3\u7801\uff0c\u53ef\u4ee5\u4f7f\u7528\u4efb\u4f55\u6587\u672c\u7f16\u8f91\u5668\u6216\u8005\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3002\u5728\u4fee\u6539\u4ee3\u7801\u4e4b\u524d\uff0c\u9700\u8981\u5148\u4ece Github \u4e0a\u5c06\u4ee3\u7801\u62c9\u53d6\u5230\u672c\u5730\u3002<\/p>\n<p>$ git pull origin master<\/p>\n<ol>\n<li>\u63d0\u4ea4\u66f4\u6539<\/li>\n<\/ol>\n<p>\u5728\u5b8c\u6210\u4ee3\u7801\u7684\u4fee\u6539\u4e4b\u540e\uff0c\u9700\u8981\u5c06\u4fee\u6539\u63d0\u4ea4\u5230 Github \u4e0a\u3002<\/p>\n<p>$ git add .<br \/>$ git commit -m &#8220;add new feature&#8221;<br \/>$ git push origin master<\/p>\n<p>\u5176\u4e2d &#8220;add new feature&#8221; \u662f\u5bf9\u4ee3\u7801\u4fee\u6539\u7684\u6ce8\u91ca\u3002<\/p>\n<ol>\n<li>\u5408\u5e76\u4ee3\u7801<\/li>\n<\/ol>\n<p>\u5982\u679c\u591a\u4e2a\u4eba\u4e00\u8d77\u534f\u4f5c\u5f00\u53d1\u4e00\u4e2a\u9879\u76ee\u65f6\uff0c\u9700\u8981\u5408\u5e76\u4ee3\u7801\u3002\u5408\u5e76\u4e4b\u524d\u9700\u8981\u5148\u62c9\u53d6\u6700\u65b0\u7684\u4ee3\u7801\u3002<\/p>\n<p>$ git pull origin master<\/p>\n<p>\u7136\u540e\u518d\u63d0\u4ea4\u4ee3\u7801\u3002<\/p>\n<ol>\n<li>\u63d0\u4ea4 Pull Request<\/li>\n<\/ol>\n<p>\u5f53\u4e00\u4e2a\u4eba\u4fee\u6539\u4e86\u9879\u76ee\u4ee3\u7801\u4e4b\u540e\uff0c\u9700\u8981\u63d0\u4ea4 Pull Request \u5c06\u4ee3\u7801\u5408\u5e76\u5230\u8fdc\u7a0b\u4ed3\u5e93\uff08Github\uff09\u7684 master \u5206\u652f\u4e0a\u3002\u8fd9\u65f6\uff0c\u5176\u4ed6\u534f\u4f5c\u8005\u53ef\u4ee5\u5bf9\u8fd9\u4e2a Pull Request \u8fdb\u884c\u8bc4\u8bba\u3001\u5ba1\u67e5\u4ee3\u7801\u7b49\u64cd\u4f5c\uff0c\u6700\u7ec8\u518d\u5408\u5e76\u5230 master \u5206\u652f\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u4f7f\u7528 Github \u7684\u57fa\u672c\u64cd\u4f5c\u6d41\u7a0b\uff0c\u76f8\u4fe1\u8bfb\u8005\u5728\u7406\u89e3\u4e86\u8fd9\u4e9b\u5185\u5bb9\u4e4b\u540e\uff0c\u53ef\u4ee5\u8f7b\u677e\u4e0a\u624b Github \u7684\u4f7f\u7528\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u6d45\u6790\u4f7f\u7528Github\u7684\u57fa\u672c\u64cd\u4f5c\u6d41\u7a0b\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\u7528 github \u7684\u65f6\u5019\uff0c\u9700\u8981\u5148\u5b89\u88c5 git \u5de5\u5177\uff0c\u518d\u914d\u7f6e github \u8d26\u6237\uff0c\u7136\u540e\u624d\u80fd\u4e0a\u4f20\u4ee3\u7801\u5230 github \u4e0a\u9762\u3002\u4e0b\u9762\u5c31\u662f\u5177\u4f53\u7684\u64cd\u4f5c\u6b65\u9aa4\uff1a \u5b89\u88c5 Git \u5de5\u5177 \u9996\u5148\u9700\u8981\u5728\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5 Git \u5de5\u5177\u3002\u5728 Windows \u64cd\u4f5c\u7cfb\u7edf\u4e0a\uff0c\u53ef\u4ee5\u4e0a Git \u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u7a0b\u5e8f\uff1b\u5728 Linux \u6216\u8005 macOS \u4e0a\uff0c\u53ef\u4ee5\u4f7f\u7528\u7cfb\u7edf\u81ea\u5e26\u7684\u5305\u7ba1\u7406\u5668\u5b89\u88c5 Git\u3002 \u521b\u5efa Github \u8d26\u6237 \u5982\u679c\u8fd8\u6ca1\u6709 Github \u8d26\u6237\uff0c\u9700\u8981\u5148\u6ce8\u518c\u4e00\u4e2a\u8d26\u6237\u3002\u5728\u6ce8\u518c\u8fc7\u7a0b\u4e2d\u9700\u8981\u586b\u5199\u7528\u6237\u540d\u3001\u7535\u5b50\u90ae\u4ef6\u5730\u5740\u548c\u5bc6\u7801\u7b49\u4fe1\u606f\u3002 \u521b\u5efa\u65b0\u9879\u76ee \u5728 Github \u754c\u9762\u4e0a\uff0c\u70b9\u51fb &#8220;New repository&#8221; \u6309\u94ae\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9879\u76ee\u3002 \u514b\u9686\u9879\u76ee \u5728\u672c\u5730\u8ba1\u7b97\u673a\u4e0a\uff0c\u4f7f\u7528 Git \u5de5\u5177\u901a\u8fc7\u547d\u4ee4\u884c\u514b\u9686 Github \u4e0a\u7684\u9879\u76ee\u4ee3\u7801\u5230\u672c\u5730\u3002 $ git clone git@github.com:username\/projectname.git \u5176\u4e2d\uff0cusername \u662f Github \u8d26\u6237\u540d\uff0cprojectname \u662f\u9879\u76ee\u540d\u79f0\u3002 \u4fee\u6539\u4ee3\u7801 \u5728\u672c\u5730\u7535\u8111\u4e0a\u4fee\u6539\u9879\u76ee\u4ee3\u7801\uff0c\u53ef\u4ee5\u4f7f\u7528\u4efb\u4f55\u6587\u672c\u7f16\u8f91\u5668\u6216\u8005\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3002\u5728\u4fee\u6539\u4ee3\u7801\u4e4b\u524d\uff0c\u9700\u8981\u5148\u4ece Github [&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-18741","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18741","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=18741"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18741\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=18741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=18741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=18741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}