{"id":18788,"date":"2024-11-19T10:24:34","date_gmt":"2024-11-19T02:24:34","guid":{"rendered":"https:\/\/fwq.ai\/blog\/18788\/"},"modified":"2024-11-19T10:24:34","modified_gmt":"2024-11-19T02:24:34","slug":"github%e4%b8%8a%e6%80%8e%e4%b9%88%e5%88%9b%e5%bb%ba%e4%bb%a3%e7%a0%81%e4%bb%93%e5%ba%93%e5%b9%b6%e4%b8%8a%e4%bc%a0%e6%ba%90%e7%a0%81","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/18788\/","title":{"rendered":"Github\u4e0a\u600e\u4e48\u521b\u5efa\u4ee3\u7801\u4ed3\u5e93\u5e76\u4e0a\u4f20\u6e90\u7801"},"content":{"rendered":"<p>github\u5df2\u7ecf\u6210\u4e3a\u7a0b\u5e8f\u5458\u6700\u91cd\u8981\u7684\u793e\u4ea4\u7f51\u7edc\u4e4b\u4e00\uff0c\u4e3a\u5f00\u6e90\u9879\u76ee\u63d0\u4f9b\u4e86\u5168\u65b0\u7684\u673a\u9047\u548c\u5e73\u53f0\u3002\u5728github\u4e0a\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u81ea\u5df1\u7684\u8d26\u6237\u521b\u5efa\u81ea\u5df1\u7684\u5f00\u6e90\u9879\u76ee\uff0c\u5e76\u4e0e\u5168\u7403\u7684\u5f00\u53d1\u8005\u8fdb\u884c\u4ea4\u6d41\u3001\u534f\u4f5c\u3002\u5982\u4f55\u8bbe\u7f6egithub\u4e0a\u7684\u6e90\u7801\uff1f\u672c\u6587\u5c06\u4e3a\u4f60\u63d0\u4f9b\u8be6\u7ec6\u7684\u6b65\u9aa4\u3002<\/p>\n<p>\u4e00\u3001\u5728Github\u4e0a\u521b\u5efa\u4ee3\u7801\u4ed3\u5e93<\/p>\n<p>\u9996\u5148\uff0c\u4f60\u9700\u8981\u5728Github\u4e0a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u4ee3\u7801\u4ed3\u5e93\u3002\u5728Github\u9996\u9875\u4e0a\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201c+\u201d\u53f7\uff0c\u9009\u62e9\u201cNew repository\u201d\u3002<\/p>\n<p>\u5728\u201cCreate a new repository\u201d\u9875\u9762\u4e0a\uff0c\u8f93\u5165\u4f60\u7684\u4ee3\u7801\u4ed3\u5e93\u540d\u79f0\uff0c\u5e76\u4e14\u6dfb\u52a0\u4e00\u4e9b\u8bf4\u660e\u3002\u4f60\u53ef\u4ee5\u9009\u62e9\u662f\u5c06\u8fd9\u4e2a\u4ed3\u5e93\u8bbe\u4e3aPublic\uff08\u516c\u5f00\uff09\u6216\u8005Private\uff08\u79c1\u6709\uff09\uff0c\u7136\u540e\u70b9\u51fb\u201cCreate Repository\u201d\u6309\u94ae\u3002<\/p>\n<p>\u4e8c\u3001\u5728Github\u4e0a\u6dfb\u52a0\u6e90\u7801<\/p>\n<p>\u5728\u5efa\u7acb\u597d\u4ee3\u7801\u4ed3\u5e93\u540e\uff0c\u4f60\u9700\u8981\u5c06\u4ee3\u7801\u4e0a\u4f20\u5230Github\u4e0a\u3002\u8fd9\u53ef\u4ee5\u4f7f\u7528\u4e24\u79cd\u65b9\u5f0f\u5b8c\u6210\u3002<\/p>\n<p>a. \u4f7f\u7528Github Desktop\u4e0a\u4f20\u6e90\u7801<\/p>\n<p>\u9996\u5148\uff0c\u4e0b\u8f7d\u5b89\u88c5Github Desktop\u3002\u6253\u5f00\u7a0b\u5e8f\uff0c\u70b9\u51fb\u201cAdd\u201d\u6309\u94ae\uff0c\u9009\u62e9\u4f60\u672c\u5730\u7684\u6e90\u7801\u6240\u5728\u4f4d\u7f6e\uff0c\u7136\u540e\u70b9\u51fb\u201cCreate Repository\u201d\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u4f60\u9700\u8981\u8f93\u5165\u4f60\u5728Github\u4e0a\u521b\u5efa\u7684\u4ed3\u5e93\u7684\u540d\u79f0\u548c\u63cf\u8ff0\u4fe1\u606f\uff0c\u5e76\u4e14\u9009\u62e9\u662f\u5426\u662fPublic\uff08\u516c\u5f00\uff09\u6216\u8005Private\uff08\u79c1\u6709\uff09\u3002\u7136\u540e\uff0c\u70b9\u51fb\u201cPublish Repository\u201d\u6309\u94ae\uff0cGithub Desktop\u4f1a\u5c06\u4f60\u7684\u6e90\u7801\u4e0a\u4f20\u5230Github\u4e0a\u3002<\/p>\n<p>b. \u4f7f\u7528\u547d\u4ee4\u884c\u4e0a\u4f20\u6e90\u7801<\/p>\n<p>\u5982\u679c\u4f60\u6bd4\u8f83\u719f\u6089\u547d\u4ee4\u884c\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u547d\u4ee4\u884c\u5c06\u6e90\u7801\u4e0a\u4f20\u5230Github\u4e0a\u3002<\/p>\n<p>\u53c2\u8003\u4e0b\u9762\u7684\u4ee3\u7801\uff1a<\/p>\n<pre>$ cd \/path\/to\/your\/local\/repository\n$ git init\n$ git add .\n$ git commit -m \"Initial commit\"\n$ git remote add origin https:\/\/github.com\/username\/repo.git\n$ git push -u origin master<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5176\u4e2d\uff0c\/path\/to\/your\/local\/repository\u662f\u4f60\u672c\u5730\u6e90\u7801\u6240\u5728\u7684\u6587\u4ef6\u5939\u8def\u5f84\uff0chttps:\/\/github.com\/username\/repo.git\u662f\u4f60\u5728Github\u4e0a\u521b\u5efa\u7684\u4ed3\u5e93\u5730\u5740\u3002<\/p>\n<p>\u4e09\u3001\u8bbe\u7f6e\u4ee3\u7801\u4ed3\u5e93<\/p>\n<p>\u73b0\u5728\u4f60\u5df2\u7ecf\u5c06\u4ee3\u7801\u4e0a\u4f20\u5230Github\u4e0a\u4e86\u3002\u63a5\u4e0b\u6765\u7684\u6b65\u9aa4\u662f\u4e3a\u4f60\u7684\u4ee3\u7801\u4ed3\u5e93\u505a\u4e00\u4e9b\u8bbe\u7f6e\u3002<\/p>\n<p>a. \u6dfb\u52a0README\u6587\u6863<\/p>\n<p>\u4e3a\u4e86\u8ba9\u5176\u4ed6\u5f00\u53d1\u8005\u66f4\u597d\u5730\u4e86\u89e3\u4f60\u7684\u5f00\u6e90\u9879\u76ee\uff0c\u4f60\u9700\u8981\u6dfb\u52a0\u4e00\u4e2aREADME\u6587\u6863\u3002\u65b0\u5efa\u4e00\u4e2a\u540d\u4e3aREADME.md\u7684\u6587\u6863\uff0c\u5e76\u5728\u5176\u4e2d\u6dfb\u52a0\u4e00\u4e9b\u57fa\u672c\u4fe1\u606f\uff0c\u4f8b\u5982\u4f60\u7684\u9879\u76ee\u540d\u79f0\u3001\u4ecb\u7ecd\u3001\u529f\u80fd\u3001\u4f7f\u7528\u65b9\u6cd5\u7b49\u3002<\/p>\n<p>b. \u8bbe\u7f6e.gitignore\u6587\u4ef6<\/p>\n<p>\u4f60\u9700\u8981\u5c06\u4f60\u7684\u4ee3\u7801\u5e93\u4e2d\u4e0d\u9700\u8981\u88ab\u4e0a\u4f20\u7684\u6587\u4ef6\u6dfb\u52a0\u5230.gitignore\u6587\u4ef6\u4e2d\u3002\u4f8b\u5982\uff0c\u4e34\u65f6\u6587\u4ef6\u3001\u65e5\u5fd7\u6587\u4ef6\u3001\u7f13\u5b58\u6587\u4ef6\u7b49\u90fd\u53ef\u4ee5\u5728\u8fd9\u91cc\u8bbe\u7f6e\u5ffd\u7565\u3002<\/p>\n<p>c. \u8bbe\u7f6eLICENSE\u6587\u4ef6<\/p>\n<p>\u4e3a\u4e86\u4fdd\u62a4\u4f60\u7684\u4ee3\u7801\u66f4\u597d\u7684\u4f7f\u7528\uff0c\u4f60\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e2a\u5f00\u6e90\u534f\u8bae\uff0c\u4ee5\u6388\u6743\u5176\u4ed6\u5f00\u53d1\u8005\u5728\u5408\u9002\u7684\u6761\u4ef6\u4e0b\u4f7f\u7528\u4f60\u7684\u4ee3\u7801\u3002\u65b0\u5efa\u4e00\u4e2a\u540d\u4e3aLICENSE\u7684\u6587\u4ef6\uff0c\u5e76\u5728\u5176\u4e2d\u9009\u62e9\u4f60\u7684\u534f\u8bae\u7c7b\u578b\uff0c\u4f8b\u5982MIT\u3001GPL\u6216\u8005Apache\u7b49\u3002<\/p>\n<p>\u56db\u3001\u5206\u4eab\u4f60\u7684\u4ee3\u7801<\/p>\n<p>\u73b0\u5728\u4f60\u5df2\u7ecf\u4e3a\u4f60\u7684\u4ee3\u7801\u5e93\u505a\u597d\u4e86\u6240\u6709\u7684\u8bbe\u7f6e\u3002\u4f60\u53ef\u4ee5\u9080\u8bf7\u4f60\u7684\u670b\u53cb\u3001\u540c\u4e8b\u6216\u8005\u5176\u4ed6\u611f\u5174\u8da3\u7684\u4eba\u4e00\u8d77\u52a0\u5165\u4f60\u7684\u9879\u76ee\uff0c\u5e76\u5206\u4eab\u4f60\u7684\u4ee3\u7801\u5e93\u7ed9\u5176\u4ed6\u5f00\u53d1\u8005\u3002<\/p>\n<p>\u901a\u8fc7Github\u4e0a\u7684Issues\u529f\u80fd\uff0c\u4f60\u53ef\u4ee5\u521b\u5efaBug\u62a5\u544a\u6216\u8005Feature\u8bf7\u6c42\u7b49\u3002\u540c\u65f6\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528Github\u7684Pull Request\u529f\u80fd\uff0c\u4ece\u5176\u4ed6\u5f00\u53d1\u8005\u7684\u4ee3\u7801\u5e93\u4e2d\u5408\u5e76\u4ee3\u7801\u5230\u81ea\u5df1\u7684\u4ee3\u7801\u5e93\u4e2d\u3002<\/p>\n<p>\u5982\u679c\u4f60\u7684\u9879\u76ee\u8d8a\u6765\u8d8a\u91cd\u8981\uff0c\u4f60\u53ef\u4ee5\u8003\u8651\u4f7f\u7528Github Pages\u529f\u80fd\uff0c\u4e3a\u4f60\u7684\u9879\u76ee\u5efa\u7acb\u4e00\u4e2a\u9759\u6001\u7f51\u7ad9\u3002<\/p>\n<p>\u603b\u7ed3<\/p>\n<p>Github\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5f88\u597d\u7684\u4ee3\u7801\u7ba1\u7406\u5e73\u53f0\uff0c\u5e76\u4e14\u6709\u8bb8\u591a\u5f3a\u5927\u7684\u534f\u4f5c\u529f\u80fd\uff0c\u4f7f\u5f97\u4ee3\u7801\u7684\u5f00\u53d1\u53d8\u5f97\u66f4\u52a0\u9ad8\u6548\u548c\u5feb\u6377\u3002\u5bf9\u4e8e\u7a0b\u5e8f\u5458\u800c\u8a00\uff0c\u638c\u63e1Github\u7684\u4f7f\u7528\u65b9\u6cd5\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u53ef\u4ee5\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u7406\u89e3\u548c\u4f7f\u7528Github\u4e0a\u7684\u6e90\u7801\u8bbe\u7f6e\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fGithub\u4e0a\u600e\u4e48\u521b\u5efa\u4ee3\u7801\u4ed3\u5e93\u5e76\u4e0a\u4f20\u6e90\u7801\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>github\u5df2\u7ecf\u6210\u4e3a\u7a0b\u5e8f\u5458\u6700\u91cd\u8981\u7684\u793e\u4ea4\u7f51\u7edc\u4e4b\u4e00\uff0c\u4e3a\u5f00\u6e90\u9879\u76ee\u63d0\u4f9b\u4e86\u5168\u65b0\u7684\u673a\u9047\u548c\u5e73\u53f0\u3002\u5728github\u4e0a\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u81ea\u5df1\u7684\u8d26\u6237\u521b\u5efa\u81ea\u5df1\u7684\u5f00\u6e90\u9879\u76ee\uff0c\u5e76\u4e0e\u5168\u7403\u7684\u5f00\u53d1\u8005\u8fdb\u884c\u4ea4\u6d41\u3001\u534f\u4f5c\u3002\u5982\u4f55\u8bbe\u7f6egithub\u4e0a\u7684\u6e90\u7801\uff1f\u672c\u6587\u5c06\u4e3a\u4f60\u63d0\u4f9b\u8be6\u7ec6\u7684\u6b65\u9aa4\u3002 \u4e00\u3001\u5728Github\u4e0a\u521b\u5efa\u4ee3\u7801\u4ed3\u5e93 \u9996\u5148\uff0c\u4f60\u9700\u8981\u5728Github\u4e0a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u4ee3\u7801\u4ed3\u5e93\u3002\u5728Github\u9996\u9875\u4e0a\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201c+\u201d\u53f7\uff0c\u9009\u62e9\u201cNew repository\u201d\u3002 \u5728\u201cCreate a new repository\u201d\u9875\u9762\u4e0a\uff0c\u8f93\u5165\u4f60\u7684\u4ee3\u7801\u4ed3\u5e93\u540d\u79f0\uff0c\u5e76\u4e14\u6dfb\u52a0\u4e00\u4e9b\u8bf4\u660e\u3002\u4f60\u53ef\u4ee5\u9009\u62e9\u662f\u5c06\u8fd9\u4e2a\u4ed3\u5e93\u8bbe\u4e3aPublic\uff08\u516c\u5f00\uff09\u6216\u8005Private\uff08\u79c1\u6709\uff09\uff0c\u7136\u540e\u70b9\u51fb\u201cCreate Repository\u201d\u6309\u94ae\u3002 \u4e8c\u3001\u5728Github\u4e0a\u6dfb\u52a0\u6e90\u7801 \u5728\u5efa\u7acb\u597d\u4ee3\u7801\u4ed3\u5e93\u540e\uff0c\u4f60\u9700\u8981\u5c06\u4ee3\u7801\u4e0a\u4f20\u5230Github\u4e0a\u3002\u8fd9\u53ef\u4ee5\u4f7f\u7528\u4e24\u79cd\u65b9\u5f0f\u5b8c\u6210\u3002 a. \u4f7f\u7528Github Desktop\u4e0a\u4f20\u6e90\u7801 \u9996\u5148\uff0c\u4e0b\u8f7d\u5b89\u88c5Github Desktop\u3002\u6253\u5f00\u7a0b\u5e8f\uff0c\u70b9\u51fb\u201cAdd\u201d\u6309\u94ae\uff0c\u9009\u62e9\u4f60\u672c\u5730\u7684\u6e90\u7801\u6240\u5728\u4f4d\u7f6e\uff0c\u7136\u540e\u70b9\u51fb\u201cCreate Repository\u201d\u3002 \u63a5\u4e0b\u6765\uff0c\u4f60\u9700\u8981\u8f93\u5165\u4f60\u5728Github\u4e0a\u521b\u5efa\u7684\u4ed3\u5e93\u7684\u540d\u79f0\u548c\u63cf\u8ff0\u4fe1\u606f\uff0c\u5e76\u4e14\u9009\u62e9\u662f\u5426\u662fPublic\uff08\u516c\u5f00\uff09\u6216\u8005Private\uff08\u79c1\u6709\uff09\u3002\u7136\u540e\uff0c\u70b9\u51fb\u201cPublish Repository\u201d\u6309\u94ae\uff0cGithub Desktop\u4f1a\u5c06\u4f60\u7684\u6e90\u7801\u4e0a\u4f20\u5230Github\u4e0a\u3002 b. \u4f7f\u7528\u547d\u4ee4\u884c\u4e0a\u4f20\u6e90\u7801 \u5982\u679c\u4f60\u6bd4\u8f83\u719f\u6089\u547d\u4ee4\u884c\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u547d\u4ee4\u884c\u5c06\u6e90\u7801\u4e0a\u4f20\u5230Github\u4e0a\u3002 \u53c2\u8003\u4e0b\u9762\u7684\u4ee3\u7801\uff1a $ cd \/path\/to\/your\/local\/repository $ git init $ git add . $ git commit -m &#8220;Initial commit&#8221; $ git remote add origin https:\/\/github.com\/username\/repo.git $ git push -u origin master \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d\uff0c\/path\/to\/your\/local\/repository\u662f\u4f60\u672c\u5730\u6e90\u7801\u6240\u5728\u7684\u6587\u4ef6\u5939\u8def\u5f84\uff0chttps:\/\/github.com\/username\/repo.git\u662f\u4f60\u5728Github\u4e0a\u521b\u5efa\u7684\u4ed3\u5e93\u5730\u5740\u3002 \u4e09\u3001\u8bbe\u7f6e\u4ee3\u7801\u4ed3\u5e93 [&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-18788","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18788","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=18788"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18788\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=18788"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=18788"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=18788"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}