{"id":60156,"date":"2023-10-31T12:06:35","date_gmt":"2023-10-31T04:06:35","guid":{"rendered":"https:\/\/docs.pingcode.com\/?p=60156"},"modified":"2023-10-31T12:06:37","modified_gmt":"2023-10-31T04:06:37","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8github%e4%b8%8a%e8%bf%9b%e8%a1%8cpush%e6%93%8d%e4%bd%9c","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/60156.html","title":{"rendered":"\u5982\u4f55\u5728GitHub\u4e0a\u8fdb\u884cpush\u64cd\u4f5c"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote\">\n<p>\u200b\u6210\u529f\u5728GitHub\u4e0a\u8fdb\u884cpush\u64cd\u4f5c\u9700\u8981\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a1.\u914d\u7f6eGit\u73af\u5883\u548c\u521b\u5efaSSH\u5bc6\u94a5\uff1b2.\u9009\u62e9\u9002\u5f53\u7684\u4ed3\u5e93\u548c\u521b\u5efa\u65b0\u5206\u652f\uff1b3.\u8fdb\u884c\u4ee3\u7801\u66f4\u6539\u5e76\u6dfb\u52a0\u5230\u6682\u5b58\u533a\uff1b4.\u63d0\u4ea4\u4f60\u7684\u66f4\u6539\uff1b5.\u6267\u884cpush\u64cd\u4f5c\u5c06\u66f4\u6539\u63a8\u9001\u5230GitHub\u4ed3\u5e93\u3002\u9996\u5148\uff0c\u786e\u4fdd\u4f60\u7684\u8ba1\u7b97\u673a\u4e0a\u5df2\u5b89\u88c5\u5e76\u914d\u7f6e\u4e86Git\u3002<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">1.\u914d\u7f6eGit\u73af\u5883\u548c\u521b\u5efaSSH\u5bc6\u94a5 <\/h2>\n\n\n\n<p>\u4e3a\u4e86\u5728GitHub\u4e0a\u8fdb\u884cpush\u64cd\u4f5c\uff0c\u786e\u4fdd\u4f60\u7684\u8ba1\u7b97\u673a\u4e0a\u5df2\u5b89\u88c5Git\u3002\u53ef\u4ee5\u4eceGit\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5\u3002\u5b89\u88c5\u540e\uff0c\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u5e76\u914d\u7f6eGit\u7684\u7528\u6237\u540d\u79f0\u548c\u7535\u5b50\u90ae\u4ef6\u3002\u63a5\u7740\uff0c\u4e3aGitHub\u521b\u5efaSSH\u5bc6\u94a5\uff0c\u4ee5\u786e\u4fdd\u5b89\u5168\u7684\u63a8\u9001\u64cd\u4f5c\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2.\u9009\u62e9\u9002\u5f53\u7684\u4ed3\u5e93\u548c\u521b\u5efa\u65b0\u5206\u652f<\/h2>\n\n\n\n<p> \u786e\u4fdd\u4f60\u6709\u6240\u9700\u4ed3\u5e93\u7684\u5199\u5165\u6743\u9650\u3002\u6700\u597d\u7684\u5b9e\u8df5\u662f\u5728\u65b0\u7684\u5206\u652f\u4e0a\u8fdb\u884c\u66f4\u6539\uff0c\u800c\u4e0d\u662f\u76f4\u63a5\u5728\u4e3b\u5206\u652f\u4e0a\u3002\u4f7f\u7528<code>git checkout -b [branch-name]<\/code>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5206\u652f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3.\u8fdb\u884c\u4ee3\u7801\u66f4\u6539\u5e76\u6dfb\u52a0\u5230\u6682\u5b58\u533a <\/h2>\n\n\n\n<p>\u5728\u672c\u5730\u4ed3\u5e93\u4e2d\u8fdb\u884c\u6240\u9700\u7684\u4ee3\u7801\u66f4\u6539\u3002\u5b8c\u6210\u540e\uff0c\u4f7f\u7528<code>git add .<\/code>\u5c06\u8fd9\u4e9b\u66f4\u6539\u6dfb\u52a0\u5230\u6682\u5b58\u533a\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4.\u63d0\u4ea4\u4f60\u7684\u66f4\u6539 <\/h2>\n\n\n\n<p>\u5728\u6dfb\u52a0\u66f4\u6539\u540e\uff0c\u4f7f\u7528<code>git commit -m \"[your-message]\"<\/code>\u63d0\u4ea4\u8fd9\u4e9b\u66f4\u6539\u3002\u786e\u4fdd\u63d0\u4ea4\u6d88\u606f\u6e05\u6670\u5730\u63cf\u8ff0\u4e86\u6240\u505a\u7684\u66f4\u6539\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">5.\u6267\u884cpush\u64cd\u4f5c\u5c06\u66f4\u6539\u63a8\u9001\u5230GitHub\u4ed3\u5e93 <\/h2>\n\n\n\n<p>\u6700\u540e\uff0c\u4f7f\u7528<code>git push origin [branch-name]<\/code>\u5c06\u4f60\u7684\u66f4\u6539\u63a8\u9001\u5230GitHub\u4ed3\u5e93\u3002\u5982\u679c\u4f7f\u7528SSH\u5bc6\u94a5\uff0c\u5219\u63a8\u9001\u8fc7\u7a0b\u5e94\u8be5\u662f\u65e0\u7f1d\u7684\u3002<\/p>\n\n\n\n<p>\u8981\u6ce8\u610f\u7684\u662f\uff0cpush\u64cd\u4f5c\u53ea\u662f\u5c06\u66f4\u6539\u53d1\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\u3002\u4e3a\u4e86\u5c06\u8fd9\u4e9b\u66f4\u6539\u5408\u5e76\u5230\u4e3b\u5206\u652f\uff0c\u8fd8\u9700\u8981\u5728GitHub\u4e0a\u521b\u5efa\u4e00\u4e2a\u62c9\u53d6\u8bf7\u6c42\u5e76\u8fdb\u884c\u5408\u5e76\u3002\u6b64\u5916\uff0c\u4e0e\u56e2\u961f\u5408\u4f5c\u65f6\uff0c\u8bf7\u786e\u4fdd\u7ecf\u5e38\u4e0e\u4e3b\u4ed3\u5e93\u540c\u6b65\uff0c\u907f\u514d\u51b2\u7a81\u3002<\/p>\n\n\n\n<p>\u603b\u4e4b\uff0cpush\u64cd\u4f5c\u662fGit\u5de5\u4f5c\u6d41\u4e2d\u7684\u4e00\u4e2a\u5173\u952e\u90e8\u5206\uff0c\u5141\u8bb8\u5f00\u53d1\u4eba\u5458\u5206\u4eab\u548c\u540c\u6b65\u4ed6\u4eec\u7684\u66f4\u6539\u3002\u901a\u8fc7\u9075\u5faa\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u786e\u4fdd\u66f4\u6539\u88ab\u5b89\u5168\u3001\u6709\u6548\u5730\u63a8\u9001\u5230GitHub\u4ed3\u5e93\uff0c\u4ece\u800c\u4e0e\u56e2\u961f\u6210\u5458\u5206\u4eab\u4f60\u7684\u5de5\u4f5c\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"484\" height=\"300\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2023\/10\/\u5982\u4f55\u5728\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u5b89\u88c5\u548c\u7ba1\u7406\u5b57\u4f53-2023-10-31T111158.511.png?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"\" class=\"wp-image-60158\" \/><\/figure><\/div>\n\n\n<p><strong>\u5e38\u89c1\u95ee\u7b54\uff1a<\/strong><\/p>\n\n\n\n<ul>\n<li><strong>Q1: \u4e3a\u4ec0\u4e48\u6211\u5728\u5c1d\u8bd5\u8fdb\u884cpush\u64cd\u4f5c\u65f6\uff0cGitHub\u63d0\u793a\u6211\u6743\u9650\u88ab\u62d2\u7edd\uff1f<\/strong> <\/li>\n\n\n\n<li>A1: \u5982\u679c\u4f60\u5728\u5c1d\u8bd5push\u5230\u4e00\u4e2a\u4f60\u6ca1\u6709\u5199\u5165\u6743\u9650\u7684\u4ed3\u5e93\uff0cGitHub\u4f1a\u62d2\u7edd\u4f60\u7684\u8bf7\u6c42\u3002\u786e\u4fdd\u4f60\u5df2\u88ab\u5217\u4e3a\u8be5\u4ed3\u5e93\u7684\u8d21\u732e\u8005\u6216\u62e5\u6709\u8005\uff0c\u5e76\u4e14\u4f60\u6b63\u5728\u4f7f\u7528\u4e0eGitHub\u5173\u8054\u7684\u6b63\u786e\u7684SSH\u5bc6\u94a5\u6216\u4e2a\u4eba\u8bbf\u95ee\u4ee4\u724c\u3002<\/li>\n<\/ul>\n\n\n\n<ul>\n<li><strong>Q2: \u6211\u5df2\u7ecfcommit\u4e86\u6211\u7684\u66f4\u6539\uff0c\u4f46\u4e3a\u4ec0\u4e48push\u4e0d\u4e0a\u53bb\uff1f<\/strong> <\/li>\n\n\n\n<li>A2: \u5728push\u4e4b\u524d\uff0c\u786e\u4fdd\u4f60\u5df2\u7ecf\u5148\u6267\u884c\u4e86<code>git pull<\/code>\u6216<code>git fetch<\/code>\u4ee5\u540c\u6b65\u8fdc\u7a0b\u4ed3\u5e93\u7684\u6700\u65b0\u66f4\u6539\u3002\u8fd9\u662f\u4e3a\u4e86\u786e\u4fdd\u4f60\u7684\u672c\u5730\u7248\u672c\u4e0e\u8fdc\u7a0b\u7248\u672c\u662f\u4e00\u81f4\u7684\uff0c\u907f\u514d\u4efb\u4f55\u51b2\u7a81\u3002\u5982\u679c\u5b58\u5728\u51b2\u7a81\uff0c\u4f60\u9700\u8981\u5148\u89e3\u51b3\u5b83\u4eec\uff0c\u7136\u540e\u518d\u5c1d\u8bd5push\u3002<\/li>\n<\/ul>\n\n\n\n<ul>\n<li><strong>Q3: \u6211\u5c1d\u8bd5push\u5230GitHub\uff0c\u4f46\u901f\u5ea6\u975e\u5e38\u6162\uff0c\u600e\u4e48\u529e\uff1f<\/strong> <\/li>\n\n\n\n<li>A3: \u8fd9\u53ef\u80fd\u662f\u7531\u4e8e\u7f51\u7edc\u95ee\u9898\u6216GitHub\u670d\u52a1\u5668\u7684\u9ad8\u8d1f\u8f7d\u5bfc\u81f4\u7684\u3002\u4f60\u53ef\u4ee5\u7a0d\u7b49\u7247\u523b\u518d\u5c1d\u8bd5\uff0c\u6216\u68c0\u67e5\u4f60\u7684\u7f51\u7edc\u8fde\u63a5\u662f\u5426\u7a33\u5b9a\u3002\u5982\u679c\u95ee\u9898\u6301\u7eed\u5b58\u5728\uff0c\u4f60\u53ef\u4ee5\u5c1d\u8bd5\u4f7f\u7528\u5176\u4ed6\u7f51\u7edc\u6216\u8054\u7cfbGitHub\u652f\u6301\u5bfb\u6c42\u5e2e\u52a9\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"\u200b\u6210\u529f\u5728GitHub\u4e0a\u8fdb\u884cpush\u64cd\u4f5c\u9700\u8981\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a1.\u914d\u7f6eGit\u73af\u5883\u548c\u521b\u5efaSSH\u5bc6\u94a5\uff1b2.\u9009\u62e9\u9002\u5f53\u7684\u4ed3\u5e93 [&hellip;]","protected":false},"author":7,"featured_media":60158,"comment_status":"closed","ping_status":"open","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\/60156"}],"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\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=60156"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/60156\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/60158"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=60156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=60156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=60156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}