{"id":260073,"date":"2024-05-15T13:23:59","date_gmt":"2024-05-15T05:23:59","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/260073.html"},"modified":"2024-05-15T13:24:06","modified_gmt":"2024-05-15T05:24:06","slug":"github%e5%a6%82%e4%bd%95%e4%bb%8e%e9%9d%9e%e6%9c%ac%e5%9c%b0%e4%bb%93%e5%ba%93%e6%8f%90%e4%ba%a4%e4%bb%a3%e7%a0%81%e8%87%b3%e8%bf%9c%e7%a8%8b%e4%bb%93%e5%ba%93%e5%95%8a","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/260073.html","title":{"rendered":"github\u5982\u4f55\u4ece\u975e\u672c\u5730\u4ed3\u5e93\u63d0\u4ea4\u4ee3\u7801\u81f3\u8fdc\u7a0b\u4ed3\u5e93\u554a"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/27111710\/dfd8a748-6117-4eec-a682-d0c82dd152f0.webp\" alt=\"github\u5982\u4f55\u4ece\u975e\u672c\u5730\u4ed3\u5e93\u63d0\u4ea4\u4ee3\u7801\u81f3\u8fdc\u7a0b\u4ed3\u5e93\u554a\" \/><\/p>\n<p><p>GitHub\u662f\u76ee\u524d\u6700\u5927\u7684\u9879\u76ee\u6258\u7ba1\u5e73\u53f0\uff0c\u80fd\u591f\u9ad8\u6548\u5730\u7ba1\u7406\u3001\u5206\u4eab\u548c\u6269\u5c55\u4f60\u7684\u4ee3\u7801\u3002\u63d0\u4ea4\u4ee3\u7801\u81f3\u8fdc\u7a0b\u4ed3\u5e93\u662f\u5f00\u53d1\u8005\u7684\u65e5\u5e38\u4efb\u52a1\u4e4b\u4e00\u3002\u8981\u4ece\u975e\u672c\u5730\u4ed3\u5e93\u63d0\u4ea4\u4ee3\u7801\u81f3\u8fdc\u7a0b\u4ed3\u5e93\uff0c\u4e3b\u8981\u65b9\u6cd5\u5305\u62ec<strong>\u4f7f\u7528Git\u547d\u4ee4\u884c\u3001\u901a\u8fc7GitHub\u7f51\u9875\u754c\u9762\u3001\u5229\u7528GitHub Desktop\u3001\u4ee5\u53ca\u7b2c\u4e09\u65b9\u5de5\u5177<\/strong>\u7b49\u3002\u5bf9\u4e8e\u591a\u6570\u5f00\u53d1\u8005\u800c\u8a00\uff0c<strong>\u4f7f\u7528Git\u547d\u4ee4\u884c<\/strong>\u662f\u6700\u57fa\u672c\u4e14\u6700\u7075\u6d3b\u7684\u65b9\u5f0f\u3002\u8fd9\u4e0d\u4ec5\u53ef\u4ee5\u8ba9\u4f60\u76f4\u63a5\u4ece\u4efb\u4f55\u4ed3\u5e93\u63d0\u4ea4\u4ee3\u7801\u81f3\u8fdc\u7a0b\u4ed3\u5e93\uff0c\u8fd8\u80fd\u66f4\u7ec6\u81f4\u5730\u63a7\u5236\u4ee3\u7801\u7684\u7248\u672c\u548c\u5206\u652f\u7ba1\u7406\u3002<\/p>\n<\/p>\n<p><p>\u8981\u4f7f\u7528Git\u547d\u4ee4\u884c\u63d0\u4ea4\u4ee3\u7801\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u4f60\u7684\u7535\u8111\u4e0a\u5df2\u5b89\u88c5Git\u3002\u4e4b\u540e\uff0c\u7528\u547d\u4ee4\u884c\u754c\u9762\u5bfc\u822a\u81f3\u4f60\u7684\u9879\u76ee\u76ee\u5f55\uff0c\u5e76\u6267\u884c\u5fc5\u8981\u7684Git\u547d\u4ee4\u6765\u521d\u59cb\u5316\u4ed3\u5e93\u3001\u6dfb\u52a0\u8fdc\u7a0b\u4ed3\u5e93\u5730\u5740\u3001\u4ee5\u53ca\u63a8\u9001\u4ee3\u7801\u81f3\u8fdc\u7a0b\u4ed3\u5e93\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u6d89\u53ca\u4e00\u7cfb\u5217\u547d\u4ee4\uff0c\u5982<code>git init<\/code>\u3001<code>git remote add origin [URL]<\/code>\u3001\u4ee5\u53ca<code>git push -u origin master<\/code>\u7b49\u3002\u6bcf\u4e2a\u547d\u4ee4\u90fd\u626e\u6f14\u4e86\u4e0d\u53ef\u6216\u7f3a\u7684\u89d2\u8272\uff0c\u7528\u4e8e\u786e\u4fdd\u4ee3\u7801\u80fd\u591f\u6b63\u786e\u548c\u9ad8\u6548\u5730\u63d0\u4ea4\u81f3\u8fdc\u7a0b\u4ed3\u5e93\u3002<\/p>\n<\/p>\n<p><h2>\u4e00\u3001\u4f7f\u7528GIT\u547d\u4ee4\u884c\u64cd\u4f5c<\/h2>\n<\/p>\n<p><h3>\u521d\u59cb\u5316\u672c\u5730\u4ed3\u5e93<\/h3>\n<\/p>\n<p><p>\u5728\u9879\u76ee\u6587\u4ef6\u5939\u4e2d\u6253\u5f00\u547d\u4ee4\u884c\u7a97\u53e3\uff0c\u9996\u5148\u6267\u884c<code>git init<\/code>\u6765\u521d\u59cb\u5316\u4e00\u4e2aGit\u4ed3\u5e93\u3002\u8fd9\u4e00\u6b65\u5c06\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>.git<\/code>\u7684\u9690\u85cf\u6587\u4ef6\u5939\uff0c\u91cc\u9762\u5305\u542b\u4e86\u4ed3\u5e93\u7684\u6240\u6709\u5143\u6570\u636e\u3002<\/p>\n<\/p>\n<p><h3>\u6dfb\u52a0\u8fdc\u7a0b\u4ed3\u5e93\u5730\u5740<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528<code>git remote add origin [\u4f60\u7684\u8fdc\u7a0b\u4ed3\u5e93URL]<\/code>\u6765\u6dfb\u52a0\u4e00\u4e2a\u540d\u4e3a\u201corigin\u201d\u7684\u8fdc\u7a0b\u4ed3\u5e93\u3002\u8fd9\u91cc\u7684URL\u662f\u4f60\u7684GitHub\u9879\u76ee\u5730\u5740\uff0c\u4f8b\u5982\uff1a<code>git remote add origin https:\/\/github.com\/yourusername\/your-repo-name.git<\/code>\u3002<\/p>\n<\/p>\n<p><h3>\u63a8\u9001\u4ee3\u7801\u81f3\u8fdc\u7a0b\u4ed3\u5e93<\/h3>\n<\/p>\n<p><p>\u5728\u4f60\u5b8c\u6210\u4ee3\u7801\u7684\u4fee\u6539\u548c\u672c\u5730\u63d0\u4ea4\uff08\u5373<code>git commit<\/code>\uff09\u4e4b\u540e\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528<code>git push -u origin master<\/code>\u547d\u4ee4\u5c06\u4ee3\u7801\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\u3002\u5982\u679c\u662f\u9996\u6b21\u63a8\u9001\u4ee3\u7801\u6216\u8005\u6709\u65b0\u7684\u5206\u652f\uff0c<code>-u<\/code>\u53c2\u6570\u5c06\u4f1a\u94fe\u63a5\u4f60\u7684\u672c\u5730\u5206\u652f\u548c\u8fdc\u7a0b\u5206\u652f\u3002<\/p>\n<\/p>\n<p><h2>\u4e8c\u3001\u901a\u8fc7GITHUB\u7f51\u9875\u754c\u9762\u4e0a\u4f20<\/h2>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u504f\u597d\u4f7f\u7528\u56fe\u5f62\u754c\u9762\u800c\u975e\u547d\u4ee4\u884c\uff0cGitHub\u4e5f\u63d0\u4f9b\u4e86\u7b80\u5355\u76f4\u89c2\u7684\u4e0a\u4f20\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><h3>\u521b\u5efa\u65b0\u7684\u6587\u4ef6\u6216\u4e0a\u4f20\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>\u5728\u9879\u76ee\u7684\u4ed3\u5e93\u9875\u9762\uff0c\u4f60\u53ef\u4ee5\u70b9\u51fb\u201cAdd file\u201d\u6309\u94ae\uff0c\u4e4b\u540e\u9009\u62e9\u201cUpload files\u201d\u6765\u4e0a\u4f20\u672c\u5730\u7684\u6587\u4ef6\u3002\u4f60\u4e5f\u53ef\u4ee5\u521b\u5efa\u65b0\u6587\u4ef6\u76f4\u63a5\u5728GitHub\u4e0a\u7f16\u8f91\u3002<\/p>\n<\/p>\n<p><h3>\u63d0\u4ea4\u548c\u63a8\u9001\u66f4\u6539<\/h3>\n<\/p>\n<p><p>\u4e0a\u4f20\u6216\u7f16\u8f91\u6587\u4ef6\u540e\uff0c\u4f60\u9700\u8981\u586b\u5199\u63d0\u4ea4\u4fe1\u606f\u5e76\u9009\u62e9\u5206\u652f\u3002GitHub\u63d0\u4f9b\u4e86\u57fa\u4e8e\u7f51\u9875\u7684\u63d0\u4ea4\u529f\u80fd\uff0c\u5141\u8bb8\u4f60\u63d0\u4ea4\u66f4\u6539\u5230\u5206\u652f\uff0c\u5e76\u53ef\u4ee5\u76f4\u63a5\u5728\u7f51\u9875\u4e0a\u53d1\u8d77\u5408\u5e76\u8bf7\u6c42\uff08Pull Request\uff09\u3002<\/p>\n<\/p>\n<p><h2>\u4e09\u3001\u5229\u7528GITHUB DESKTOP<\/h2>\n<\/p>\n<p><p>\u5bf9\u4e8e\u90a3\u4e9b\u559c\u6b22\u56fe\u5f62\u5316\u64cd\u4f5c\u754c\u9762\u7684\u7528\u6237\uff0cGitHub Desktop\u662f\u4e00\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u79cd\u65b9\u4fbf\u7684\u65b9\u5f0f\u6765\u540c\u6b65\u672c\u5730\u548c\u8fdc\u7a0b\u4ed3\u5e93\uff0c\u800c\u4e14\u652f\u6301\u57fa\u672c\u7684Git\u547d\u4ee4\u3002<\/p>\n<\/p>\n<p><h3>\u514b\u9686\u548c\u540c\u6b65\u4ed3\u5e93<\/h3>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u4f60\u9700\u8981\u514b\u9686\u4e00\u4e2a\u8fdc\u7a0b\u4ed3\u5e93\u5230\u672c\u5730\uff0c\u6216\u8005\u628a\u73b0\u6709\u7684\u672c\u5730\u4ed3\u5e93\u4e0eGitHub\u8d26\u6237\u76f8\u5173\u8054\u3002\u4e4b\u540e\uff0c\u4efb\u4f55\u672c\u5730\u7684\u63d0\u4ea4\u90fd\u53ef\u4ee5\u901a\u8fc7GitHub Desktop\u65b9\u4fbf\u5730\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\u3002<\/p>\n<\/p>\n<p><h3>\u5206\u652f\u7ba1\u7406\u548c\u63d0\u4ea4\u4ee3\u7801<\/h3>\n<\/p>\n<p><p>GitHub Desktop\u5141\u8bb8\u4f60\u8f7b\u677e\u7ba1\u7406\u4e0d\u540c\u7684\u5206\u652f\uff0c\u5e76\u63d0\u4ea4\u4ee3\u7801\u81f3\u8fdc\u7a0b\u4ed3\u5e93\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u76f4\u89c2\u7684\u754c\u9762\u6765\u8ddf\u8e2a\u66f4\u6539\u3001\u9884\u89c8\u5dee\u5f02\uff0c\u5e76\u6267\u884c\u63d0\u4ea4\u548c\u63a8\u9001\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><h2>\u56db\u3001\u4f7f\u7528\u7b2c\u4e09\u65b9\u5de5\u5177<\/h2>\n<\/p>\n<p><p>\u8fd8\u6709\u4e00\u4e9b\u7b2c\u4e09\u65b9\u5de5\u5177\u548cIDE\uff08\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff09\u63d2\u4ef6\u652f\u6301\u4e0eGitHub\u7684\u96c6\u6210\uff0c\u5982Visual Studio Code\u3001Atom\u7b49\u3002<\/p>\n<\/p>\n<p><h3>\u7ed3\u5408IDE\u5de5\u5177\u7684git\u63d2\u4ef6<\/h3>\n<\/p>\n<p><p>\u8bb8\u591a\u73b0\u4ee3IDE\u90fd\u63d0\u4f9b\u4e86Git\u63d2\u4ef6\uff0c\u53ef\u4ee5\u5728\u4e0d\u79bb\u5f00\u7f16\u8f91\u5668\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u7248\u672c\u63a7\u5236\u64cd\u4f5c\u3002\u8fd9\u4e9b\u63d2\u4ef6\u901a\u5e38\u5305\u62ec\u66f4\u6539\u7684\u53ef\u89c6\u5316\u3001\u5206\u652f\u7ba1\u7406\u548c\u8fdc\u7a0b\u4ed3\u5e93\u7684\u540c\u6b65\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><h3>\u914d\u7f6e\u548c\u4f7f\u7528\u63d2\u4ef6<\/h3>\n<\/p>\n<p><p>\u5b89\u88c5\u76f8\u5e94\u7684Git\u63d2\u4ef6\u540e\uff0c\u901a\u5e38\u9700\u8981\u5728\u8bbe\u7f6e\u4e2d\u914d\u7f6e\u4f60\u7684GitHub\u8d26\u6237\u4fe1\u606f\u3002\u968f\u540e\uff0c\u4f60\u5c31\u53ef\u4ee5\u901a\u8fc7IDE\u4e2d\u7684\u56fe\u5f62\u64cd\u4f5c\u754c\u9762\u6765\u6267\u884c\u6240\u6709\u5fc5\u8981\u7684Git\u547d\u4ee4\uff0c\u4ece\u800c\u628a\u4ee3\u7801\u63a8\u9001\u81f3\u8fdc\u7a0b\u4ed3\u5e93\u3002<\/p>\n<\/p>\n<p><p><strong>\u603b\u7ed3<\/strong>\uff0c\u4ece\u975e\u672c\u5730\u4ed3\u5e93\u63d0\u4ea4\u4ee3\u7801\u81f3\u8fdc\u7a0b\u4ed3\u5e93\u7684\u65b9\u6cd5\u591a\u79cd\u591a\u6837\uff0c\u5305\u62ec\u547d\u4ee4\u884c\u64cd\u4f5c\u3001GitHub\u7f51\u9875\u754c\u9762\u3001GitHub Desktop\u4ee5\u53ca\u7b2c\u4e09\u65b9\u5de5\u5177\u6216IDE\u63d2\u4ef6\u3002\u6bcf\u79cd\u65b9\u6cd5\u90fd\u6709\u5176\u4f18\u52bf\u548c\u5e94\u7528\u573a\u666f\uff0c\u4f60\u53ef\u4ee5\u6839\u636e\u4e2a\u4eba\u559c\u597d\u548c\u9879\u76ee\u9700\u6c42\u9009\u62e9\u6700\u5408\u9002\u7684\u4e00\u79cd\u6216\u591a\u79cd\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<ul>\n<li><strong>\u5982\u4f55\u5c06\u975e\u672c\u5730\u4ed3\u5e93\u4e2d\u7684\u4ee3\u7801\u63d0\u4ea4\u5230\u8fdc\u7a0b\u4ed3\u5e93\uff1f<\/strong><br \/>\n\u5982\u679c\u60a8\u60f3\u8981\u5c06\u4f4d\u4e8e\u975e\u672c\u5730\u4ed3\u5e93\u7684\u4ee3\u7801\u63d0\u4ea4\u5230\u8fdc\u7a0b\u4ed3\u5e93\uff0c\u60a8\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u64cd\u4f5c\uff1a<\/li>\n<\/ul>\n<ol>\n<li>\u9996\u5148\uff0c\u5c06\u60a8\u7684\u4ee3\u7801\u4ece\u975e\u672c\u5730\u4ed3\u5e93\u514b\u9686\u5230\u672c\u5730\u8ba1\u7b97\u673a\u4e0a\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528Git\u547d\u4ee4\u884c\u6216\u8005\u53ef\u89c6\u5316\u5de5\u5177\uff08\u5982GitHub Desktop\uff09\u8fdb\u884c\u514b\u9686\u3002<\/li>\n<li>\u63a5\u4e0b\u6765\uff0c\u5c06\u60a8\u7684\u4ee3\u7801\u6dfb\u52a0\u5230\u672c\u5730\u4ed3\u5e93\u7684\u6682\u5b58\u533a\u4e2d\uff0c\u4f7f\u7528<code>git add<\/code>\u547d\u4ee4\u3002\u8fd9\u5c06\u4f1a\u628a\u60a8\u7684\u4ee3\u7801\u53d8\u66f4\u4ece\u5de5\u4f5c\u76ee\u5f55\u6dfb\u52a0\u5230\u6682\u5b58\u533a\uff0c\u51c6\u5907\u63d0\u4ea4\u5230\u8fdc\u7a0b\u4ed3\u5e93\u3002<\/li>\n<li>\u63a5\u7740\uff0c\u4f7f\u7528<code>git commit<\/code>\u547d\u4ee4\u5c06\u60a8\u7684\u4ee3\u7801\u53d8\u66f4\u63d0\u4ea4\u5230\u672c\u5730\u4ed3\u5e93\u3002\u60a8\u53ef\u4ee5\u5728\u8be5\u547d\u4ee4\u540e\u9762\u52a0\u4e0a\u76f8\u5173\u7684\u63d0\u4ea4\u4fe1\u606f\uff0c\u4ee5\u4fbf\u5176\u4ed6\u4eba\u4e86\u89e3\u60a8\u7684\u4ee3\u7801\u53d8\u66f4\u5185\u5bb9\u3002<\/li>\n<li>\u6700\u540e\uff0c\u4f7f\u7528<code>git push<\/code>\u547d\u4ee4\u5c06\u60a8\u7684\u4ee3\u7801\u63d0\u4ea4\u5230\u8fdc\u7a0b\u4ed3\u5e93\u3002\u60a8\u9700\u8981\u6307\u5b9a\u8fdc\u7a0b\u4ed3\u5e93\u7684\u540d\u79f0\u548c\u5206\u652f\uff0c\u4ee5\u53ca\u8f93\u5165\u60a8\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801\uff08\u6216\u914d\u7f6eSSH\u5bc6\u94a5\uff09\u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\u3002<\/li>\n<\/ol>\n<p>\u8bf7\u786e\u4fdd\u5728\u5c06\u4ee3\u7801\u63d0\u4ea4\u5230\u8fdc\u7a0b\u4ed3\u5e93\u4e4b\u524d\uff0c\u60a8\u5df2\u7ecf\u6b63\u786e\u5730\u8fdb\u884c\u4e86\u514b\u9686\u3001\u6dfb\u52a0\u548c\u63d0\u4ea4\u64cd\u4f5c\u3002\u8fd9\u6837\uff0c\u60a8\u7684\u4ee3\u7801\u624d\u80fd\u6210\u529f\u5730\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\u4e2d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"GitHub\u662f\u76ee\u524d\u6700\u5927\u7684\u9879\u76ee\u6258\u7ba1\u5e73\u53f0\uff0c\u80fd\u591f\u9ad8\u6548\u5730\u7ba1\u7406\u3001\u5206\u4eab\u548c\u6269\u5c55\u4f60\u7684\u4ee3\u7801\u3002\u63d0\u4ea4\u4ee3\u7801\u81f3\u8fdc\u7a0b\u4ed3\u5e93\u662f\u5f00\u53d1\u8005\u7684\u65e5\u5e38\u4efb\u52a1 [&hellip;]","protected":false},"author":3,"featured_media":260081,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/260073"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=260073"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/260073\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/260081"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=260073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=260073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=260073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}