{"id":48732,"date":"2025-07-30T13:12:40","date_gmt":"2025-07-30T05:12:40","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/48732.html"},"modified":"2025-07-30T13:12:40","modified_gmt":"2025-07-30T05:12:40","slug":"c%e5%90%8e%e7%ab%af%e7%bc%96%e7%a8%8b-%e6%9e%84%e5%bb%ba%e9%ab%98%e6%80%a7%e8%83%bd%e5%90%8e%e7%ab%af%e7%9a%84%e6%95%b0%e6%8d%ae%e5%ba%93%e3%80%81api-%e4%b8%8e-web-%e6%9c%8d%e5%8a%a1%e5%99%a8-4","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/48732.html","title":{"rendered":"C++\u540e\u7aef\u7f16\u7a0b \u6784\u5efa\u9ad8\u6027\u80fd\u540e\u7aef\u7684\u6570\u636e\u5e93\u3001API \u4e0e Web \u670d\u52a1\u5668 4 \u7cbe\u901a\u7248\u672c\u63a7\u5236\u2014\u2014Git \u4e0e GitHub"},"content":{"rendered":"<h2 id=\"aid_121\" style=\"text-align:justify\"><span style=\"color:#000000\">\u7248\u672c\u63a7\u5236\u4e0e\u4ee3\u7801\u6258\u7ba1&#xff1a;\u6982\u8ff0<\/span><\/h2>\n<p><span style=\"color:#000000\">\u5728\u590d\u6742\u7684\u8f6f\u4ef6\u5f00\u53d1\u9886\u57df&#xff0c;\u7279\u522b\u662f\u540e\u7aef\u7f16\u7a0b\u4e2d&#xff0c;\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u548c\u4ee3\u7801\u6258\u7ba1\u670d\u52a1\u662f\u4e0d\u53ef\u6216\u7f3a\u7684\u5de5\u5177\u3002\u00a0\u5b83\u4eec\u4e0d\u4ec5\u5e2e\u52a9\u7ba1\u7406\u53d8\u66f4\u5e76\u4fdd\u6301\u9879\u76ee\u7ec4\u7ec7\u6709\u5e8f&#xff0c;\u8fd8\u80fd\u7b80\u5316\u534f\u4f5c\u6d41\u7a0b\u3001\u4fc3\u8fdb\u900f\u660e\u5ea6&#xff0c;\u5e76\u63d0\u5347\u4ee3\u7801\u5e93\u7684\u6574\u4f53\u8d28\u91cf\u3002\u00a0\u8fd9\u4e9b\u4f18\u52bf\u662f\u5728\u7ba1\u7406\u53d8\u66f4\u548c\u4fdd\u6301\u9879\u76ee\u6709\u5e8f\u7684\u57fa\u7840\u529f\u80fd\u4e4b\u5916\u7684\u989d\u5916\u4ef7\u503c\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u5f00\u53d1\u8005\u80fd\u591f\u901a\u8fc7\u4f7f\u7528\u8bf8\u5982 Git \u7b49\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u6765\u5bfc\u822a\u548c\u7ba1\u7406\u9879\u76ee\u7684\u8fdb\u5c55&#xff0c;\u8fd9\u4e9b\u7cfb\u7edf\u63d0\u4f9b\u4e86\u5bf9\u4ee3\u7801\u5e93\u6240\u505a\u4fee\u6539\u7684\u5b8c\u6574\u5386\u53f2\u8bb0\u5f55\u3002\u00a0\u5b83\u4eec\u4f7f\u5f97\u591a\u540d\u5f00\u53d1\u8005\u53ef\u4ee5\u540c\u65f6\u5728\u540c\u4e00\u4ee3\u7801\u5e93\u4e0a\u5de5\u4f5c\u800c\u4e0d\u4f1a\u8986\u76d6\u5f7c\u6b64\u7684\u66f4\u6539&#xff0c;\u8fd9\u4e00\u7279\u6027\u5728\u540e\u7aef\u5f00\u53d1\u4e2d\u5c24\u4e3a\u6709\u7528&#xff0c;\u56e0\u4e3a\u56e2\u961f\u7ecf\u5e38\u9700\u8981\u534f\u4f5c\u5f00\u53d1\u590d\u6742\u7cfb\u7edf\u3002\u00a0\u7248\u672c\u63a7\u5236\u8fd8\u63d0\u4f9b\u4e86\u751f\u6210\u9879\u76ee\u591a\u4e2a\u7248\u672c\u7684\u80fd\u529b&#xff0c;\u8fd9\u6709\u52a9\u4e8e\u5728\u4e0d\u5f71\u54cd\u4e3b\u5e94\u7528\u7a0b\u5e8f\u529f\u80fd\u7684\u60c5\u51b5\u4e0b\u6d4b\u8bd5\u65b0\u7279\u6027\u3002\u00a0\u5982\u679c\u4ee3\u7801\u51fa\u73b0\u95ee\u9898&#xff0c;\u5f00\u53d1\u8005\u53ef\u4ee5\u8f7b\u677e\u56de\u6eda\u5230\u4ee3\u7801\u7684\u65e9\u671f\u7248\u672c\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u6b64\u5916&#xff0c;\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u901a\u8fc7\u5c06\u6bcf\u6b21\u53d8\u66f4\u5173\u8054\u5230\u7279\u5b9a\u5f00\u53d1\u8005&#xff0c;\u5b9e\u73b0\u4e86\u8d23\u4efb\u5f52\u5c5e\u4e0e\u53d8\u66f4\u8ffd\u6eaf\u3002\u00a0\u8fd9\u4f7f\u5f97\u8ffd\u8e2a\u6bcf\u9879\u4fee\u6539\u7684\u8d1f\u8d23\u4eba\u6210\u4e3a\u53ef\u80fd\u3002\u00a0\u6b63\u56e0\u5982\u6b64&#xff0c;\u6211\u4eec\u53ef\u4ee5\u8f7b\u677e\u5b9a\u4f4d\u67d0\u6bb5\u4ee3\u7801\u6216\u67d0\u4e2a\u7f3a\u9677\u7684\u5f15\u5165\u8005\u3002\u00a0\u8be5\u529f\u80fd\u5728\u540e\u7aef\u5f00\u53d1\u4e2d\u5c24\u4e3a\u5b9e\u7528&#xff0c;\u56e0\u4e3a\u76f8\u6bd4\u524d\u7aef\u5f00\u53d1&#xff0c;\u540e\u7aef\u5f80\u5f80\u6d89\u53ca\u66f4\u591a\u76f8\u4e92\u5173\u8054\u7684\u7cfb\u7edf\u4e0e\u670d\u52a1\u3002\u00a0\u8fd9\u4e5f\u5bfc\u81f4\u95ee\u9898\u6839\u6e90\u7684\u5b9a\u4f4d\u4f1a\u66f4\u52a0\u56f0\u96be\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u4ee3\u7801\u6258\u7ba1\u670d\u52a1\u5982 GitHub \u548c Bitbucket&#xff0c;\u4f5c\u4e3a\u96c6\u4e2d\u5b58\u50a8\u548c\u5171\u4eab\u8ba1\u7b97\u673a\u4ee3\u7801\u7684\u5e73\u53f0\u3002\u00a0\u5b83\u4eec\u4e0d\u4ec5\u5229\u7528\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u7684\u6838\u5fc3\u529f\u80fd&#xff0c;\u8fd8\u901a\u8fc7\u95ee\u9898\u8ffd\u8e2a\u3001\u62c9\u53d6\u8bf7\u6c42\u3001\u4ee3\u7801\u5ba1\u67e5\u548c\u6587\u6863\u7ba1\u7406\u7b49\u9644\u52a0\u7279\u6027\u589e\u5f3a\u7cfb\u7edf\u80fd\u529b\u3002\u00a0\u8fd9\u4e9b\u670d\u52a1\u7b80\u5316\u4e86\u56e2\u961f\u534f\u4f5c\u6d41\u7a0b&#xff0c;\u4f7f\u8fdb\u5ea6\u8ddf\u8e2a\u3001\u53d8\u66f4\u8ba8\u8bba\u548c\u610f\u89c1\u53cd\u9988\u66f4\u52a0\u9ad8\u6548&#xff0c;\u6700\u7ec8\u4ea7\u51fa\u66f4\u9ad8\u8d28\u91cf\u7684\u4ee3\u7801\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u8fd9\u4e9b\u529f\u80fd\u5728\u540e\u7aef\u5f00\u53d1\u7684\u80cc\u666f\u4e0b\u63d0\u4f9b\u4e86\u5de8\u5927\u7684\u4ef7\u503c\u3002\u00a0\u540e\u7aef\u4ee3\u7801\u5f80\u5f80\u96be\u4ee5\u7406\u89e3&#xff0c;\u5373\u4f7f\u5fae\u5c0f\u7684\u6539\u52a8\u4e5f\u53ef\u80fd\u4ea7\u751f\u6df1\u8fdc\u5f71\u54cd\u3002\u00a0\u4ee3\u7801\u6258\u7ba1\u670d\u52a1\u4e0d\u4ec5\u786e\u4fdd\u4ee3\u7801\u529f\u80fd\u6b63\u5e38&#xff0c;\u8fd8\u4f7f\u5176\u5177\u6709\u53ef\u7ef4\u62a4\u6027\u3001\u9ad8\u6548\u6027\u4e14\u6587\u6863\u5b8c\u5584\u3002\u00a0\u8fd9\u662f\u901a\u8fc7\u4fc3\u8fdb\u4ee3\u7801\u5ba1\u67e5\u548c\u56f4\u7ed5\u53d8\u66f4\u7684\u8ba8\u8bba\u6765\u5b9e\u73b0\u7684\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u7b80\u800c\u8a00\u4e4b&#xff0c;\u540e\u7aef\u5f00\u53d1\u6700\u91cd\u8981\u7684\u5de5\u5177\u662f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u548c\u4ee3\u7801\u6258\u7ba1\u670d\u52a1\u3002\u00a0\u5b83\u4eec\u4f7f\u5f00\u53d1\u8fc7\u7a0b\u66f4\u9ad8\u6548&#xff0c;\u63d0\u5347\u534f\u4f5c\u80fd\u529b&#xff0c;\u63d0\u9ad8\u4ee3\u7801\u8d28\u91cf\u6c34\u5e73&#xff0c;\u6700\u7ec8\u6709\u52a9\u4e8e\u5f00\u53d1\u51fa\u53ef\u9760\u4e14\u5065\u58ee\u7684\u540e\u7aef\u7cfb\u7edf\u3002<\/span><\/p>\n<h2 id=\"aid_66\" style=\"text-align:justify\"><span style=\"color:#000000\">\u63a2\u7d22 Git<\/span><\/h2>\n<p><span style=\"color:#000000\">Git \u662f\u4e00\u79cd\u5e7f\u6cdb\u4f7f\u7528\u7684\u7248\u672c\u63a7\u5236\u7cfb\u7edf&#xff0c;\u53ef\u5e2e\u52a9\u5f00\u53d1\u8005\u7ba1\u7406\u548c\u8ffd\u8e2a\u4ee3\u7801\u53d8\u66f4\u3002\u00a0\u5728\u56e2\u961f\u534f\u4f5c\u73af\u5883\u4e2d\u5c24\u4e3a\u5b9e\u7528&#xff0c;\u5141\u8bb8\u591a\u4eba\u540c\u65f6\u5f00\u53d1\u9879\u76ee\u800c\u4e0d\u4f1a\u8986\u76d6\u5f7c\u6b64\u7684\u4fee\u6539\u3002\u00a0\u4ee5\u4e0b\u662f\u5728 C&#043;&#043;\u73af\u5883\u4e2d\u914d\u7f6e Git \u7684\u9010\u6b65\u6307\u5357&#xff1a;<\/span><\/p>\n<p>\u00a0<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"359\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730051239-6889a9c72351c.png\" width=\"1216\" \/><\/p>\n<p><span style=\"color:#000000\">\u56fe 4.1 Git \u914d\u7f6e<\/span><\/p>\n<p><span style=\"color:#000000\">\u5b89\u88c5 Git<\/span><\/p>\n<p><span style=\"color:#000000\">\u9996\u5148&#xff0c;\u60a8\u9700\u8981\u5728\u7cfb\u7edf\u4e0a\u5b89\u88c5 Git\u3002\u00a0\u60a8\u53ef\u4ee5\u4ece Git \u5b98\u7f51\u4e0b\u8f7d\u3002\u00a0\u9009\u62e9\u4e0e\u60a8\u64cd\u4f5c\u7cfb\u7edf\u5bf9\u5e94\u7684\u7248\u672c\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u25cf\u00a0Windows \u7528\u6237\u53ef\u4ece https:\/\/git-scm.com\/download\/win \u4e0b\u8f7d<\/span><\/p>\n<p><span style=\"color:#000000\">\u25cf\u00a0MacOS \u7528\u6237\u53ef\u4f7f\u7528 Homebrew \u547d\u4ee4 brew install git<\/span><\/p>\n<p><span style=\"color:#000000\">\u25cf\u00a0Linux(Ubuntu)\u7528\u6237\u53ef\u4f7f\u7528\u547d\u4ee4 sudo apt-get install git<\/span><\/p>\n<p>\u914d\u7f6e Git<\/p>\n<p>\u5b89\u88c5 Git \u540e&#xff0c;\u60a8\u9700\u8981\u5bf9\u5176\u8fdb\u884c\u914d\u7f6e\u3002\u6253\u5f00\u60a8\u7684\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26&#xff0c;\u7136\u540e\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4&#xff1a;<\/p>\n<p>\u25cf \u8bbe\u7f6e\u60a8\u7684\u59d3\u540d&#xff1a;git config &#8211;global user.name &#034;\u60a8\u7684\u59d3\u540d&#034;<\/p>\n<p>\u25cf \u8bbe\u7f6e\u60a8\u7684\u7535\u5b50\u90ae\u4ef6&#xff1a;git config &#8211;global user.email &#034;youremail&#064;myblogapp.com&#034;<\/p>\n<p><span style=\"color:#000000\">\u8fd9\u4e9b\u4fe1\u606f\u5c06\u4e0e\u60a8\u521b\u5efa\u7684\u4efb\u4f55\u63d0\u4ea4\u76f8\u5173\u8054\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u521d\u59cb\u5316 Git \u4ed3\u5e93<\/span><\/p>\n<p><span style=\"color:#000000\">\u8981\u5f00\u59cb\u4f7f\u7528 Git&#xff0c;\u60a8\u9700\u8981\u5728\u9879\u76ee\u76ee\u5f55\u4e2d\u521d\u59cb\u5316\u4e00\u4e2a Git \u4ed3\u5e93\u3002\u00a0\u4f7f\u7528\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u5bfc\u822a\u5230\u60a8\u7684 C&#043;&#043; \u9879\u76ee\u6587\u4ef6\u5939&#xff0c;\u7136\u540e\u8f93\u5165 git init\u3002\u00a0\u6b64\u547d\u4ee4\u5c06\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a .git \u7684\u65b0\u5b50\u76ee\u5f55&#xff0c;\u5176\u4e2d\u5305\u542b\u65b0\u4ed3\u5e93\u6240\u9700\u7684\u6240\u6709\u5143\u6570\u636e\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u8ddf\u8e2a\u66f4\u6539<\/span><\/p>\n<p><span style=\"color:#000000\">\u521d\u59cb\u5316\u4ed3\u5e93\u540e&#xff0c;\u60a8\u5c31\u53ef\u4ee5\u5f00\u59cb\u8ddf\u8e2a\u53d8\u66f4\u4e86\u3002\u00a0\u5f53\u60a8\u521b\u5efa\u3001\u4fee\u6539\u6216\u5220\u9664\u6587\u4ef6\u65f6&#xff0c;Git \u80fd\u591f\u8ffd\u8e2a\u8fd9\u4e9b\u53d8\u66f4\u3002\u00a0\u4f7f\u7528\u547d\u4ee4 git add .\u00a0\u5c06\u53d8\u66f4\u6682\u5b58&#xff0c;\u518d\u901a\u8fc7 git commit -m &#034;\u63d0\u4ea4\u4fe1\u606f&#034; \u5c06\u8fd9\u4e9b\u53d8\u66f4\u4fdd\u5b58\u5230\u4ed3\u5e93\u4e2d\u3002\u00a0\u63d0\u4ea4\u4fe1\u606f\u5e94\u63cf\u8ff0\u60a8\u6240\u505a\u7684\u5177\u4f53\u4fee\u6539\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u68c0\u67e5\u72b6\u6001<\/span><\/p>\n<p><span style=\"color:#000000\">\u60a8\u53ef\u4ee5\u4f7f\u7528 git status \u547d\u4ee4\u67e5\u770b\u4ed3\u5e93\u72b6\u6001\u3002\u00a0\u8be5\u547d\u4ee4\u4f1a\u663e\u793a\u5df2\u6682\u5b58\u7684\u53d8\u66f4\u3001\u5c1a\u672a\u6682\u5b58\u7684\u53d8\u66f4\u4ee5\u53ca\u672a\u88ab\u8ddf\u8e2a\u7684\u6587\u4ef6\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u8fd9\u4e2a\u521d\u59cb\u8bbe\u7f6e\u8db3\u4ee5\u8ba9\u60a8\u5728 C&#043;&#043;\u73af\u5883\u4e2d\u5f00\u59cb\u4f7f\u7528 Git\u3002\u00a0\u968f\u7740\u5bf9 Git \u7684\u4f7f\u7528\u6df1\u5165&#xff0c;\u60a8\u5c06\u5b66\u4e60\u66f4\u9ad8\u7ea7\u7684\u547d\u4ee4\u548c\u6982\u5ff5&#xff0c;\u4f8b\u5982\u5206\u652f\u3001\u5408\u5e76\u548c\u51b2\u7a81\u89e3\u51b3\u3002\u00a0\u5728\u56e2\u961f\u6216\u516c\u5171\u9879\u76ee\u4e2d&#xff0c;\u60a8\u8fd8\u9700\u8981\u5b66\u4e60\u5982\u4f55\u4ece\u8fdc\u7a0b\u4ed3\u5e93\u62c9\u53d6\u53d8\u66f4\u53ca\u63a8\u9001\u53d8\u66f4\u5230\u8fdc\u7a0b\u4ed3\u5e93\u3002<\/span><\/p>\n<h2 id=\"aid_226\" style=\"text-align:justify\"><span style=\"color:#000000\">Git \u57fa\u672c\u547d\u4ee4\u4e0e\u5de5\u4f5c\u6d41\u7a0b<\/span><\/h2>\n<p><span style=\"color:#000000\">\u5728\u5b8c\u6210\u8bbe\u7f6e\u540e&#xff0c;\u8ba9\u6211\u4eec\u6df1\u5165\u63a2\u8ba8 Git \u7684\u57fa\u672c\u547d\u4ee4\u548c\u5de5\u4f5c\u6d41\u7a0b\u3002\u00a0\u6211\u4eec\u5c06\u4ece\u5178\u578b\u540e\u7aef\u5f00\u53d1\u9879\u76ee\u7684\u89d2\u5ea6\u6765\u7406\u89e3\u8fd9\u4e9b\u5185\u5bb9\u3002\u00a0\u5728\u540e\u7aef\u5f00\u53d1\u4e2d&#xff0c;\u6211\u4eec\u9700\u8981\u5904\u7406\u590d\u6742\u7684\u4ee3\u7801\u5e93\u548c\u534f\u4f5c\u56e2\u961f&#xff0c;\u56e0\u6b64\u638c\u63e1 Git \u7684\u5de5\u4f5c\u6d41\u7a0b\u81f3\u5173\u91cd\u8981\u3002\u00a0\u4ee5\u4e0b\u662f\u57fa\u672c\u547d\u4ee4\u5217\u8868&#xff1a;<\/span><\/p>\n<p><span style=\"color:#000000\">git clone<\/span><\/p>\n<p><span style=\"color:#000000\">\u5f53\u60a8\u9700\u8981\u64cd\u4f5c\u73b0\u6709\u4ee3\u7801\u5e93\u65f6&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u514b\u9686\u547d\u4ee4\u3002\u00a0\u8fd9\u4f1a\u5c06\u4ee3\u7801\u5e93\u4e0b\u8f7d\u5230\u60a8\u7684\u672c\u5730\u673a\u5668\u3002\u00a0\u547d\u4ee4\u683c\u5f0f\u4e3a git clone \u3002\u00a0\u8bf7\u5c06\u66ff\u6362\u4e3a\u60a8\u8981\u514b\u9686\u7684\u4ee3\u7801\u5e93 URL\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u4f8b\u5982&#xff0c;\u5982\u679c\u4f60\u60f3\u4e3a\u6258\u7ba1\u5728 GitHub \u4e0a\u7684\u4e00\u4e2a\u5f00\u6e90\u540e\u7aef\u9879\u76ee\u505a\u8d21\u732e&#xff0c;\u9996\u5148\u9700\u8981\u514b\u9686\u8be5\u4ee3\u7801\u5e93&#xff1a;<\/span><\/p>\n<p><span style=\"background-color:#efefef\"><span style=\"color:#000000\"><span style=\"background-color:#efefef\">git clone https:\/\/github.com\/username\/repository.git<\/span><\/span><\/span><\/p>\n<p><span style=\"color:#000000\">\u8fd9\u4f1a\u5728\u5f53\u524d\u6587\u4ef6\u5939\u4e2d\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a repository \u7684\u76ee\u5f55\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">git status<\/span><\/p>\n<p><span style=\"color:#000000\">git status \u547d\u4ee4\u7528\u4e8e\u663e\u793a\u5de5\u4f5c\u76ee\u5f55\u548c\u6682\u5b58\u533a\u7684\u72b6\u6001\u3002\u00a0\u5b83\u4f1a\u5c55\u793a\u54ea\u4e9b\u53d8\u66f4\u5df2\u6682\u5b58\u3001\u54ea\u4e9b\u672a\u6682\u5b58&#xff0c;\u4ee5\u53ca\u54ea\u4e9b\u6587\u4ef6\u672a\u88ab Git \u8ddf\u8e2a\u3002\u00a0\u8be5\u547d\u4ee4\u5e2e\u52a9\u60a8\u4e86\u89e3\u9879\u76ee\u72b6\u6001\u53ca\u5df2\u505a\u51fa\u7684\u53d8\u66f4\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">git add<\/span><\/p>\n<p><span style=\"color:#000000\">git add \u547d\u4ee4\u7528\u4e8e\u5c06\u53d8\u66f4\u6682\u5b58\u4ee5\u5907\u4e0b\u6b21\u63d0\u4ea4\u3002\u00a0\u8be5\u547d\u4ee4\u544a\u77e5 Git \u60a8\u5e0c\u671b\u5c06\u7279\u5b9a\u6587\u4ef6\u7684\u66f4\u65b0\u5305\u542b\u5728\u4e0b\u4e00\u6b21\u63d0\u4ea4\u4e2d\u3002\u00a0\u82e5\u8981\u6dfb\u52a0\u5de5\u4f5c\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u53d8\u66f4&#xff0c;\u8bf7\u4f7f\u7528 git add\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">git commit<\/span><\/p>\n<p><span style=\"color:#000000\">git commit \u547d\u4ee4\u7528\u4e8e\u5c06\u66f4\u6539\u4fdd\u5b58\u5230\u672c\u5730\u4ed3\u5e93\u3002\u00a0\u6bcf\u6b21\u63d0\u4ea4\u90fd\u662f\u60a8\u5de5\u4f5c\u7684\u4e00\u4e2a&#034;\u5feb\u7167&#034;&#xff0c;\u53ef\u4ee5\u5728\u9700\u8981\u65f6\u56de\u9000\u5230\u8be5\u72b6\u6001\u3002\u00a0\u63d0\u4ea4\u65f6\u9644\u5e26\u6d88\u606f\u662f\u826f\u597d\u7684\u5b9e\u8df5&#xff0c;\u56e0\u4e3a\u5b83\u4e3a\u6240\u505a\u7684\u66f4\u6539\u63d0\u4f9b\u4e86\u4e0a\u4e0b\u6587\u3002\u00a0\u53ef\u4ee5\u4f7f\u7528 git commit -m &#034;\u60a8\u7684\u6d88\u606f&#034; \u6765\u5b8c\u6210\u6b64\u64cd\u4f5c\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">git push<\/span><\/p>\n<p><span style=\"color:#000000\">git push \u547d\u4ee4\u7528\u4e8e\u5c06\u672c\u5730\u4ed3\u5e93\u5185\u5bb9\u4e0a\u4f20\u5230\u8fdc\u7a0b\u4ed3\u5e93\u3002\u00a0\u5728\u672c\u5730\u63d0\u4ea4\u66f4\u6539\u540e&#xff0c;\u60a8\u53ef\u4ee5\u901a\u8fc7\u5c06\u66f4\u6539\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\u6765\u4e0e\u56e2\u961f\u5176\u4ed6\u6210\u5458\u6216\u516c\u4f17\u5206\u4eab\u60a8\u7684\u63d0\u4ea4\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">git pull<\/span><\/p>\n<p><span style=\"color:#000000\">git pull \u547d\u4ee4\u7528\u4e8e\u4ece\u8fdc\u7a0b\u4ed3\u5e93\u83b7\u53d6\u5e76\u4e0b\u8f7d\u5185\u5bb9&#xff0c;\u5e76\u7acb\u5373\u66f4\u65b0\u672c\u5730\u4ed3\u5e93\u4ee5\u5339\u914d\u8be5\u5185\u5bb9\u3002\u00a0\u8fd9\u662f\u5c06\u672c\u5730\u4ed3\u5e93\u4e0e\u8fdc\u7a0b\u4ed3\u5e93\u6700\u65b0\u66f4\u6539\u540c\u6b65\u7684\u4fbf\u6377\u65b9\u5f0f\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">git branch<\/span><\/p>\n<p><span style=\"color:#000000\">git branch \u547d\u4ee4\u7528\u4e8e\u7ba1\u7406 Git \u4e2d\u7684\u5206\u652f\u3002\u00a0\u5206\u652f\u672c\u8d28\u4e0a\u662f\u6307\u5411\u9879\u76ee\u6587\u4ef6\u4e0d\u540c\u7248\u672c\u7684\u6307\u9488\u3002\u00a0\u5f53\u60a8\u60f3\u6dfb\u52a0\u65b0\u529f\u80fd\u6216\u4fee\u590d\u9519\u8bef&#xff0c;\u53c8\u4e0d\u60f3\u5f71\u54cd\u4e3b\u9879\u76ee\u65f6&#xff0c;\u5b83\u4eec\u975e\u5e38\u6709\u7528\u3002git branch \u547d\u4ee4\u5141\u8bb8\u60a8\u521b\u5efa\u3001\u5217\u51fa\u3001\u91cd\u547d\u540d\u548c\u5220\u9664\u5206\u652f\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">git checkout<\/span><\/p>\n<p><span style=\"color:#000000\">git checkout \u547d\u4ee4\u7528\u4e8e\u5728 Git \u4e2d\u5207\u6362\u4e0d\u540c\u5206\u652f\u3002\u00a0\u5f53\u60a8\u68c0\u51fa\u67d0\u4e2a\u5206\u652f\u65f6&#xff0c;Git \u4f1a\u5c06\u60a8\u7684\u5de5\u4f5c\u76ee\u5f55\u66f4\u65b0\u4e3a\u8be5\u5206\u652f\u4e0a\u7684\u9879\u76ee\u6587\u4ef6\u7248\u672c\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">git merge<\/span><\/p>\n<p><span style=\"color:#000000\">git merge \u547d\u4ee4\u7528\u4e8e\u5c06\u4e00\u4e2a\u5206\u652f\u7684\u53d8\u66f4\u5408\u5e76\u5230\u53e6\u4e00\u4e2a\u5206\u652f\u3002\u00a0\u901a\u5e38\u5728\u60a8\u5df2\u5b8c\u6210\u67d0\u4e2a\u529f\u80fd\u5f00\u53d1\u6216\u9519\u8bef\u4fee\u590d\u7684\u5206\u652f\u5de5\u4f5c&#xff0c;\u5e76\u5e0c\u671b\u5c06\u8fd9\u4e9b\u53d8\u66f4\u96c6\u6210\u5230\u4e3b\u4ee3\u7801\u5e93\u65f6\u4f7f\u7528\u6b64\u547d\u4ee4\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u4ee5\u4e0b\u662f\u7b80\u5355 Git \u5de5\u4f5c\u6d41\u7a0b\u7684\u53ef\u89c6\u5316\u8868\u793a&#xff1a;<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"473\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730051239-6889a9c75cea4.png\" width=\"113\" \/><\/p>\n<p><span style=\"color:#000000\">\u56fe 4.2 Git \u5de5\u4f5c\u6d41\u7a0b<\/span><\/p>\n<p><span style=\"color:#000000\">\u5047\u8bbe\u4f60\u6b63\u5728\u4e3a\u540e\u7aef\u5f00\u53d1\u4e00\u4e2a\u65b0\u529f\u80fd&#xff0c;\u6bd4\u5982\u4e00\u4e2a\u65b0\u7684 API \u7aef\u70b9\u3002\u00a0\u4f60\u4f1a\u4ece\u514b\u9686\u4ed3\u5e93\u5f00\u59cb&#xff0c;\u7136\u540e\u4f7f\u7528 git branch new-feature \u521b\u5efa\u65b0\u5206\u652f\u3002\u00a0\u63a5\u7740\u7528 git checkout new-feature \u5207\u6362\u5230\u8be5\u5206\u652f\u5e76\u5f00\u59cb\u6784\u5efa\u529f\u80fd\u3002\u00a0\u5728\u7f16\u7801\u548c\u6d4b\u8bd5\u8fc7\u7a0b\u4e2d&#xff0c;\u4f60\u53ef\u80fd\u4f1a\u591a\u6b21\u63d0\u4ea4\u3002\u00a0\u5f53\u529f\u80fd\u5b8c\u6210\u5e76\u901a\u8fc7\u6d4b\u8bd5\u540e&#xff0c;\u4f60\u4f1a\u7528 git checkout main \u5207\u6362\u56de\u4e3b\u5206\u652f&#xff0c;\u7136\u540e\u6267\u884c git merge new-feature \u8fdb\u884c\u5408\u5e76\u3002\u00a0\u6700\u540e\u7528 git push \u63a8\u9001\u66f4\u6539&#xff0c;\u4f7f\u65b0\u529f\u80fd\u6210\u4e3a\u4e3b\u4ee3\u7801\u5e93\u7684\u4e00\u90e8\u5206\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u5177\u4f53\u6d41\u7a0b\u53ef\u80fd\u56e0\u56e2\u961f\u5de5\u4f5c\u65b9\u5f0f\u800c\u5f02&#xff0c;\u4f46\u8fd9\u4e9b\u57fa\u7840 Git \u547d\u4ee4\u6784\u6210\u4e86\u4efb\u4f55\u540e\u7aef\u5f00\u53d1\u9879\u76ee\u7248\u672c\u63a7\u5236\u7684\u6838\u5fc3\u3002<\/span><\/p>\n<h2 id=\"aid_183\" style=\"text-align:justify\"><span style=\"color:#000000\">\u5206\u652f\u4e0e\u5408\u5e76<\/span><\/h2>\n<p><span style=\"color:#000000\">\u5206\u652f\u4e0e\u5408\u5e76\u662f Git \u6700\u5f3a\u5927\u7684\u4e24\u9879\u529f\u80fd\u3002\u00a0\u5b83\u4eec\u8ba9\u5f00\u53d1\u8005\u80fd\u591f\u540c\u65f6\u5904\u7406\u4e0d\u540c\u529f\u80fd\u800c\u4e92\u4e0d\u5e72\u6270&#xff0c;\u4e4b\u540e\u53c8\u80fd\u65e0\u7f1d\u5408\u5e76\u5404\u81ea\u7684\u4fee\u6539\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u5206\u652f<\/span><\/p>\n<p><span style=\"color:#000000\">Git \u5206\u652f\u672c\u8d28\u4e0a\u662f\u6307\u5411\u7279\u5b9a\u63d0\u4ea4\u7684\u6307\u9488\u3002\u00a0\u5b83\u4ee3\u8868\u9879\u76ee\u4e2d\u72ec\u7acb\u7684\u5f00\u53d1\u7ebf&#xff0c;\u53ef\u7528\u4e8e\u9694\u79bb\u7279\u5b9a\u529f\u80fd\u6216\u7f3a\u9677\u4fee\u590d\u7684\u5f00\u53d1\u5de5\u4f5c\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u60a8\u53ef\u4ee5\u4f7f\u7528 git branch &lt;branch-name&gt; \u547d\u4ee4\u521b\u5efa\u65b0\u5206\u652f\u3002\u00a0\u4f8b\u5982&#xff0c;\u5982\u679c\u60a8\u8981\u4e3a\u540e\u7aef\u6dfb\u52a0\u65b0\u7684 REST \u7aef\u70b9&#xff0c;\u53ef\u4ee5\u4e3a\u6b64\u5de5\u4f5c\u521b\u5efa\u4e00\u4e2a\u65b0\u5206\u652f&#xff1a;<\/span><\/p>\n<p>git branch add-endpoint<\/p>\n<p><span style=\"color:#000000\">\u8981\u5207\u6362\u5230\u8be5\u65b0\u5206\u652f\u5e76\u5f00\u59cb\u5de5\u4f5c&#xff0c;\u60a8\u9700\u8981\u4f7f\u7528 git checkout &lt;branch-name&gt; \u547d\u4ee4&#xff1a;<\/span><\/p>\n<p>git checkout add-endpoint<\/p>\n<p><span style=\"color:#000000\">\u5408\u5e76<\/span><\/p>\n<p><span style=\"color:#000000\">\u5408\u5e76\u662f Git \u4e2d\u7684\u57fa\u672c\u64cd\u4f5c&#xff0c;\u5b83\u5141\u8bb8\u4f60\u5c06\u4e0d\u540c\u5206\u652f\u7684\u5de5\u4f5c\u5185\u5bb9\u6574\u5408\u5230\u4e00\u8d77\u3002\u00a0\u5f53\u4f60\u5728\u67d0\u4e2a\u72ec\u7acb\u5206\u652f\u4e0a\u5b8c\u6210\u5de5\u4f5c\u540e&#xff0c;\u901a\u5e38\u9700\u8981\u5c06\u8fd9\u4e9b\u5de5\u4f5c\u6210\u679c\u5408\u5e76\u56de\u4e3b\u5f00\u53d1\u7ebf&#xff08;\u901a\u5e38\u79f0\u4e3a main \u6216 master \u5206\u652f&#xff09;\u3002\u00a0\u8fd9\u79cd\u5c06\u4e00\u4e2a\u5206\u652f\u7684\u53d8\u66f4\u6574\u5408\u5230\u53e6\u4e00\u4e2a\u5206\u652f\u7684\u8fc7\u7a0b\u5c31\u662f\u6211\u4eec\u6240\u8bf4\u7684\u5408\u5e76\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u8981\u5728 Git \u4e2d\u5408\u5e76\u5206\u652f&#xff0c;\u9996\u5148\u9700\u8981\u5207\u6362\u5230\u76ee\u6807\u5408\u5e76\u5206\u652f\u3002\u00a0\u8fd9\u53ef\u4ee5\u901a\u8fc7 git checkout \u547d\u4ee4\u5b9e\u73b0\u3002\u00a0\u4f8b\u5982&#xff0c;\u82e5\u8981\u5408\u5e76\u5230 main \u5206\u652f&#xff0c;\u4f60\u9700\u8981\u6267\u884c&#xff1a;<\/span><\/p>\n<p>git checkout main<\/p>\n<p><span style=\"color:#000000\">\u5f53\u60a8\u5207\u6362\u5230\u76ee\u6807\u5206\u652f\u540e&#xff0c;\u5c31\u53ef\u4ee5\u5c06\u7279\u6027\u5206\u652f\u5408\u5e76\u5230\u5176\u4e2d\u3002\u00a0\u8fd9\u9700\u8981\u4f7f\u7528 git merge \u547d\u4ee4\u6765\u5b8c\u6210\u3002\u00a0\u4f8b\u5982&#xff0c;\u5982\u679c\u60a8\u7684\u7279\u6027\u5206\u652f\u540d\u4e3a add-endpoint&#xff0c;\u5219\u5e94\u6267\u884c&#xff1a;<\/span><\/p>\n<p>git merge add-endpoint<\/p>\n<p><span style=\"color:#000000\">Git \u968f\u540e\u4f1a\u5c1d\u8bd5\u81ea\u52a8\u5c06 add-endpoint \u5206\u652f\u7684\u53d8\u66f4\u5408\u5e76\u5230\u4e3b\u5206\u652f\u3002\u00a0\u5982\u679c Git \u80fd\u6210\u529f\u534f\u8c03\u4e24\u4e2a\u5206\u652f\u7684\u53d8\u66f4&#xff0c;\u5408\u5e76\u5c06\u81ea\u52a8\u5b8c\u6210\u3002\u00a0\u4f46\u82e5\u540c\u4e00\u884c\u4ee3\u7801\u6216\u4ee3\u7801\u6bb5\u5728\u4e24\u4e2a\u5206\u652f\u4e2d\u90fd\u88ab\u4fee\u6539\u8fc7&#xff0c;Git \u5c06\u65e0\u6cd5\u786e\u5b9a\u54ea\u4e2a\u53d8\u66f4\u5e94\u4f18\u5148\u4fdd\u7559\u3002\u00a0\u8fd9\u4f1a\u5bfc\u81f4\u5408\u5e76\u51b2\u7a81&#xff0c;\u9700\u8981\u4eba\u5de5\u5e72\u9884\u89e3\u51b3\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u4ee5\u4e0b\u56fe\u8868\u63d0\u4f9b\u4e86 Git \u4e2d\u5206\u652f\u4e0e\u5408\u5e76\u6d41\u7a0b\u7684\u7b80\u5316\u53ef\u89c6\u5316\u8868\u793a&#xff1a;<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"181\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730051239-6889a9c76a49d.png\" width=\"501\" \/><\/p>\n<p><span style=\"color:#000000\">\u56fe4.3 \u5206\u652f\u4e0e\u5408\u5e76<\/span><\/p>\n<p><span style=\"color:#000000\">\u5206\u652f\u4e0e\u5408\u5e76\u529f\u80fd\u4f7f Git \u5177\u6709\u60ca\u4eba\u7684\u7075\u6d3b\u6027\u3002\u00a0\u5b83\u5141\u8bb8\u591a\u540d\u5f00\u53d1\u8005\u5728\u5404\u81ea\u72ec\u7acb\u7684\u73af\u5883\u4e2d\u540c\u65f6\u5f00\u5c55\u9879\u76ee\u5de5\u4f5c\u3002\u00a0\u5f53\u4ed6\u4eec\u51c6\u5907\u5c31\u7eea\u65f6&#xff0c;\u5373\u4f7f\u671f\u95f4\u5df2\u6709\u5176\u4ed6\u5de5\u4f5c\u5b8c\u6210&#xff0c;\u4ecd\u80fd\u5c06\u81ea\u5df1\u7684\u53d8\u66f4\u5408\u5e76\u56de\u4e3b\u4ee3\u7801\u5e93\u3002<\/span><\/p>\n<h2 id=\"aid_191\" style=\"text-align:justify\"><span style=\"color:#000000\">\u8bbe\u7f6e GitHub<\/span><\/h2>\n<p><span style=\"color:#000000\">GitHub \u662f\u4e00\u4e2a\u5141\u8bb8\u5f00\u53d1\u8005\u5728\u4e91\u7aef\u6258\u7ba1\u548c\u7ba1\u7406 Git \u4ee3\u7801\u5e93\u7684\u5e73\u53f0\u3002\u00a0\u5b83\u4e0d\u4ec5\u63d0\u4f9b\u4e86\u5b58\u50a8\u4ee3\u7801\u7684\u573a\u6240&#xff0c;\u8fd8\u63d0\u4f9b\u5404\u79cd\u4fc3\u8fdb\u534f\u4f5c\u5f00\u53d1\u7684\u5de5\u5177&#xff0c;\u4f8b\u5982\u95ee\u9898\u8ddf\u8e2a\u3001\u4ee3\u7801\u5ba1\u67e5\u548c\u81ea\u52a8\u5316\u6d4b\u8bd5\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u4ee5\u4e0b\u9010\u6b65\u6307\u5357\u5c06\u5c55\u793a\u5982\u4f55\u4e3a\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u8bbe\u7f6e\u548c\u914d\u7f6e GitHub&#xff1a;<\/span><\/p>\n<p><span style=\"color:#000000\">\u6ce8\u518c\u5e76\u521b\u5efa\u65b0\u4ed3\u5e93<\/span><\/p>\n<p><span style=\"color:#000000\">\u9996\u5148&#xff0c;\u5982\u679c\u60a8\u8fd8\u6ca1\u6709 GitHub \u8d26\u6237&#xff0c;\u9700\u8981\u5148\u6ce8\u518c\u4e00\u4e2a\u3002\u00a0\u767b\u5f55\u540e&#xff0c;\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684&#034;&#043;&#034;\u56fe\u6807\u5e76\u9009\u62e9&#034;New repository&#034;\u5373\u53ef\u521b\u5efa\u65b0\u4ed3\u5e93\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u7cfb\u7edf\u4f1a\u8981\u6c42\u60a8\u4e3a\u4ed3\u5e93\u547d\u540d\u5e76\u63d0\u4f9b\u7b80\u77ed\u63cf\u8ff0\u3002\u00a0\u60a8\u8fd8\u53ef\u4ee5\u9009\u62e9\u5c06\u4ed3\u5e93\u8bbe\u4e3a\u516c\u5f00\u6216\u79c1\u6709&#xff0c;\u4ee5\u53ca\u662f\u5426\u521d\u59cb\u5316\u5305\u542b README \u6587\u4ef6\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u5c06\u672c\u5730\u4ed3\u5e93\u5173\u8054\u5230 GitHub<\/span><\/p>\n<p><span style=\"color:#000000\">GitHub \u4ed3\u5e93\u521b\u5efa\u5b8c\u6210\u540e&#xff0c;\u60a8\u53ef\u4ee5\u5c06\u5176\u4e0e\u672c\u5730\u4ed3\u5e93\u5173\u8054\u3002\u00a0\u9996\u5148\u901a\u8fc7\u7ec8\u7aef\u6216\u547d\u4ee4\u884c\u5bfc\u822a\u81f3\u60a8\u7684\u672c\u5730\u4ed3\u5e93\u3002\u00a0\u7136\u540e\u5c06 GitHub \u4ed3\u5e93\u6dfb\u52a0\u4e3a\u8fdc\u7a0b\u4ed3\u5e93&#xff08;remote&#xff09;&#xff0c;\u8fd9\u662f\u6258\u7ba1\u5728\u670d\u52a1\u5668\u4e0a\u7684\u9879\u76ee\u7248\u672c&#xff1a;<\/span><\/p>\n<p>git remote add origin https:\/\/github.com\/username\/repository.git<\/p>\n<p><span style=\"color:#000000\">\u5c06&#034;username&#034;\u66ff\u6362\u4e3a\u4f60\u7684 GitHub \u7528\u6237\u540d&#xff0c;&#034;repository&#034;\u66ff\u6362\u4e3a\u4f60\u7684 GitHub \u4ed3\u5e93\u540d\u79f0<\/span><\/p>\n<p><span style=\"color:#000000\">\u5c06\u672c\u5730\u4ee3\u7801\u63a8\u9001\u81f3 GitHub<\/span><\/p>\n<p><span style=\"color:#000000\">\u73b0\u5728\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06\u672c\u5730\u4ee3\u7801\u63a8\u9001\u81f3 GitHub&#xff1a;<\/span><\/p>\n<p>git push -u origin main<\/p>\n<p><span style=\"color:#000000\">\u8be5\u547d\u4ee4\u5c06\u60a8\u7684\u4ee3\u7801\u63a8\u9001\u5230\u540d\u4e3a&#034;origin&#034;\u7684\u8fdc\u7a0b\u4ed3\u5e93\u7684&#034;main&#034;\u5206\u652f&#xff0c;\u5373\u60a8\u7684 GitHub \u4ee3\u7801\u5e93\u3002-u \u53c2\u6570\u4f1a\u5728\u672c\u5730\u4ed3\u5e93\u4e0e\u8fdc\u7a0b\u4ed3\u5e93\u4e4b\u95f4\u5efa\u7acb\u8ddf\u8e2a\u5173\u7cfb&#xff0c;\u4f7f\u540e\u7eed\u7684\u63a8\u9001(push)\u548c\u62c9\u53d6(pull)\u64cd\u4f5c\u66f4\u52a0\u4fbf\u6377\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u534f\u4f5c\u5f00\u53d1<\/span><\/p>\n<p><span style=\"color:#000000\">\u73b0\u5728\u60a8\u7684\u4ee3\u7801\u5df2\u6258\u7ba1\u5728 GitHub \u4e0a&#xff0c;\u53ef\u4ee5\u8f7b\u677e\u4e0e\u4ed6\u4eba\u534f\u4f5c\u3002\u00a0\u60a8\u53ef\u4ee5\u9080\u8bf7\u4ed6\u4eba\u53c2\u4e0e\u9879\u76ee\u8d21\u732e\u3001\u63d0\u4ea4\u53d8\u66f4\u4f9b\u60a8\u5ba1\u9605&#xff0c;\u6216\u8005\u5141\u8bb8\u4ed6\u4eec\u590d\u523b(fork)\u60a8\u7684\u4ed3\u5e93\u5e76\u5f00\u53d1\u72ec\u7acb\u7248\u672c\u3002\u00a0\u60a8\u8fd8\u53ef\u4ee5\u5229\u7528 GitHub \u7684\u62c9\u53d6\u8bf7\u6c42(pull requests)\u3001\u95ee\u9898\u8ffd\u8e2a(issues)\u548c\u81ea\u52a8\u5316\u64cd\u4f5c(actions)\u7b49\u529f\u80fd\u6765\u4f18\u5316\u5f00\u53d1\u6d41\u7a0b\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u83b7\u53d6\u5e76\u5408\u5e76\u66f4\u6539<\/span><\/p>\n<p><span style=\"color:#000000\">\u5982\u679c\u4f60\u4e0e\u4ed6\u4eba\u534f\u4f5c\u5f00\u53d1&#xff0c;\u9700\u8981\u5b9a\u671f\u4ece\u8fdc\u7a0b\u4ed3\u5e93\u83b7\u53d6\u5e76\u5408\u5e76\u53d8\u66f4\u3002\u00a0\u4f60\u53ef\u4ee5\u4f7f\u7528 git fetch origin \u83b7\u53d6\u6700\u65b0\u66f4\u6539&#xff0c;\u7136\u540e\u901a\u8fc7 git merge origin\/main \u5408\u5e76&#034;main&#034;\u5206\u652f\u4e0a\u7684\u65b0\u63d0\u4ea4\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u7b80\u800c\u8a00\u4e4b&#xff0c;GitHub \u548c Git \u7ed3\u5408\u4f7f\u7528\u65f6&#xff0c;\u6784\u6210\u4e86\u540e\u7aef\u5f00\u53d1\u7684\u5f3a\u5927\u5de5\u5177\u96c6\u3002\u00a0\u501f\u52a9\u8fd9\u4e9b\u5de5\u5177&#xff0c;\u4f60\u53ef\u4ee5\u8f7b\u677e\u7ba1\u7406\u548c\u8ddf\u8e2a\u4ee3\u7801\u5e93\u53d8\u66f4&#xff0c;\u4e0e\u4ed6\u4eba\u534f\u4f5c&#xff0c;\u5e76\u7ef4\u62a4\u7ed3\u6784\u826f\u597d\u7684\u5f00\u53d1\u5de5\u4f5c\u6d41\u7a0b\u3002<\/span><\/p>\n<h2 id=\"aid_91\" style=\"text-align:justify\"><span style=\"color:#000000\">\u4ed3\u5e93\u3001\u5206\u652f\u4e0e\u62c9\u53d6\u8bf7\u6c42<\/span><\/h2>\n<p><span style=\"color:#000000\">\u4ed3\u5e93<\/span><\/p>\n<p><span style=\"color:#000000\">\u5728 GitHub \u4e2d&#xff0c;\u4ed3\u5e93&#xff08;\u6216&#034;repo&#034;&#xff09;\u662f\u9879\u76ee\u7684\u5de5\u4f5c\u7a7a\u95f4\u3002\u00a0\u5b83\u5305\u542b\u9879\u76ee\u7684\u6240\u6709\u6587\u4ef6&#xff0c;\u5e76\u5b58\u50a8\u6bcf\u4e2a\u6587\u4ef6\u7684\u4fee\u8ba2\u5386\u53f2\u3002\u00a0\u4ed3\u5e93\u8fd8\u53ef\u4ee5\u6709\u591a\u4e2a\u534f\u4f5c\u8005&#xff0c;\u53ef\u4ee5\u662f\u516c\u5f00\u7684\u6216\u79c1\u6709\u7684\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u8981\u521b\u5efa\u65b0\u4ed3\u5e93&#xff0c;\u8bf7\u70b9\u51fb GitHub \u8d26\u6237\u53f3\u4e0a\u89d2\u7684\u52a0\u53f7&#xff0c;\u7136\u540e\u9009\u62e9&#034;\u65b0\u5efa\u4ed3\u5e93&#034;\u3002\u00a0\u63a5\u7740\u60a8\u53ef\u4ee5\u6307\u5b9a\u4ed3\u5e93\u7684\u540d\u79f0\u3001\u63cf\u8ff0\u548c\u53ef\u89c1\u6027\u8bbe\u7f6e\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u521b\u5efa\u4ed3\u5e93\u540e&#xff0c;\u60a8\u53ef\u4ee5\u4f7f\u7528 git clone \u547d\u4ee4\u5c06\u5176\u514b\u9686\u5230\u672c\u5730\u673a\u5668&#xff0c;\u8fd9\u4f1a\u5728\u60a8\u7684\u8ba1\u7b97\u673a\u4e0a\u521b\u5efa\u4ed3\u5e93\u7684\u672c\u5730\u526f\u672c&#xff1a;<\/span><\/p>\n<p>git clone https:\/\/github.com\/username\/repository.git<\/p>\n<p><span style=\"color:#000000\">\u590d\u523b(Forking)<\/span><\/p>\n<p><span style=\"color:#000000\">\u590d\u523b\u662f\u6307\u5c06\u4ed6\u4eba\u7684\u4ed3\u5e93\u590d\u5236\u5230\u60a8\u81ea\u5df1\u7684 GitHub \u8d26\u6237\u7684\u8fc7\u7a0b\u3002\u00a0\u8fd9\u4f7f\u60a8\u53ef\u4ee5\u81ea\u7531\u5c1d\u8bd5\u4fee\u6539&#xff0c;\u800c\u4e0d\u4f1a\u5f71\u54cd\u539f\u59cb\u9879\u76ee\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u60a8\u53ef\u4ee5\u901a\u8fc7\u8bbf\u95ee\u4ed3\u5e93\u7684 GitHub \u9875\u9762&#xff0c;\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684&#034;Fork&#034;\u6309\u94ae\u6765\u6d3e\u751f\u4e00\u4e2a\u4ed3\u5e93\u3002\u00a0\u4e00\u65e6\u4ed3\u5e93\u88ab\u6d3e\u751f\u5230\u60a8\u7684\u8d26\u6237&#xff0c;\u5c31\u53ef\u4ee5\u5c06\u5176\u514b\u9686\u5230\u672c\u5730\u673a\u5668&#xff0c;\u5e76\u50cf\u5bf9\u5f85\u5176\u4ed6 GitHub \u4ed3\u5e93\u4e00\u6837\u8fdb\u884c\u64cd\u4f5c\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u62c9\u53d6\u8bf7\u6c42<\/span><\/p>\n<p><span style=\"color:#000000\">\u62c9\u53d6\u8bf7\u6c42(PR)\u662f GitHub \u4e0a\u4fc3\u8fdb\u534f\u4f5c\u7684\u529f\u80fd\u3002\u00a0\u5b83\u4eec\u662f\u4e00\u79cd\u5411\u9879\u76ee\u63d0\u8bae\u66f4\u6539\u7684\u65b9\u5f0f&#xff1a;\u60a8\u5bf9\u4ed3\u5e93\u8fdb\u884c\u4fee\u6539&#xff0c;\u5c06\u8fd9\u4e9b\u4fee\u6539\u63a8\u9001\u5230 GitHub \u4ed3\u5e93\u7684\u4e00\u4e2a\u5206\u652f&#xff0c;\u7136\u540e\u53d1\u8d77\u62c9\u53d6\u8bf7\u6c42\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u4ed3\u5e93\u7ef4\u62a4\u8005\u968f\u540e\u53ef\u4ee5\u5ba1\u67e5\u60a8\u7684\u66f4\u6539&#xff0c;\u8ba8\u8bba\u4fee\u6539\u5185\u5bb9&#xff0c;\u5e76\u6700\u7ec8\u63a5\u53d7\u6216\u62d2\u7edd\u60a8\u63d0\u8bae\u7684\u66f4\u6539\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u4ee5\u4e0b\u662f\u57fa\u672c\u5de5\u4f5c\u6d41\u7a0b&#xff1a;<\/span><\/p>\n<p><span style=\"color:#000000\">\u25cf\u00a0\u521b\u5efa\u65b0\u5206\u652f&#xff1a;git checkout -b my-feature\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u25cf\u00a0\u4fee\u6539\u4ee3\u7801\u5e76\u63d0\u4ea4&#xff1a;git commit -am &#034;\u6dfb\u52a0\u65b0\u529f\u80fd&#034;\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u25cf\u00a0\u5c06\u66f4\u6539\u63a8\u9001\u5230 GitHub \u4e0a\u7684\u4e2a\u4eba\u5206\u652f&#xff1a;git push origin my-feature\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u25cf\u00a0\u5bfc\u822a\u5230\u60a8\u5728 GitHub \u4e0a\u7684 fork \u4ed3\u5e93&#xff0c;\u5207\u6362\u5230&#034;my-feature&#034;\u5206\u652f&#xff0c;\u7136\u540e\u70b9\u51fb&#034;New Pull Request&#034;\u6309\u94ae\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u25cf\u00a0PR \u521b\u5efa\u540e&#xff0c;\u9879\u76ee\u7ef4\u62a4\u8005\u53ef\u4ee5\u5ba1\u67e5\u60a8\u7684\u66f4\u6539&#xff0c;\u9009\u62e9\u5c06\u5176\u5408\u5e76\u5230\u9879\u76ee\u4e2d\u6216\u63d0\u4f9b\u53cd\u9988\u8ba9\u60a8\u8fdb\u884c\u8c03\u6574\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u901a\u8fc7\u7406\u89e3\u548c\u4f7f\u7528\u4ed3\u5e93\u3001fork \u548c\u62c9\u53d6\u8bf7\u6c42&#xff0c;\u60a8\u5c06\u80fd\u591f\u5f88\u597d\u5730\u4e3a\u5f00\u6e90\u9879\u76ee\u505a\u8d21\u732e&#xff0c;\u5e76\u4e0e GitHub \u4e0a\u7684\u5176\u4ed6\u5f00\u53d1\u8005\u534f\u4f5c\u3002\u00a0\u8fd9\u4e9b\u6982\u5ff5\u6784\u6210\u4e86\u8bb8\u591a\u73b0\u4ee3\u5f00\u53d1\u5de5\u4f5c\u6d41\u7a0b\u7684\u57fa\u7840&#xff0c;\u662f\u540e\u7aef\u5f00\u53d1\u4eba\u5458\u5fc5\u5907\u7684\u5de5\u5177\u3002<\/span><\/p>\n<h2 id=\"aid_284\" style=\"text-align:justify\"><span style=\"color:#000000\">\u4f7f\u7528 Git \u8fdb\u884c\u6807\u7b7e\u6807\u8bb0\u3001\u6682\u5b58\u548c\u64a4\u9500\u66f4\u6539<\/span><\/h2>\n<p><span style=\"color:#000000\">\u6807\u7b7e\u6807\u8bb0<\/span><\/p>\n<p><span style=\"color:#000000\">Git \u4e2d\u7684\u6807\u7b7e\u6807\u8bb0\u529f\u80fd\u7528\u4e8e\u5c06\u9879\u76ee\u5386\u53f2\u4e2d\u7684\u7279\u5b9a\u8282\u70b9\u6807\u8bb0\u4e3a\u91cd\u8981\u8282\u70b9\u3002\u00a0\u5f00\u53d1\u8005\u901a\u5e38\u4f7f\u7528\u6b64\u529f\u80fd\u6765\u6807\u8bb0\u53d1\u5e03\u70b9&#xff08;\u5982 v1.0\u3001v2.0 \u7b49&#xff09;\u3002\u00a0\u6362\u8a00\u4e4b&#xff0c;\u6807\u7b7e\u662f\u6307\u5411 Git \u5386\u53f2\u4e2d\u7279\u5b9a\u8282\u70b9\u7684\u5f15\u7528\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u8981\u521b\u5efa\u65b0\u6807\u7b7e&#xff0c;\u53ef\u4ee5\u4f7f\u7528 git tag \u547d\u4ee4\u3002\u00a0\u4f8b\u5982&#xff0c;\u8981\u521b\u5efa\u540d\u4e3a v1.0 \u7684\u6807\u7b7e&#xff0c;\u53ef\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4&#xff1a;<\/span><\/p>\n<p>git tag v1.0<\/p>\n<p><span style=\"color:#000000\">\u8981\u5217\u51fa\u4ed3\u5e93\u4e2d\u6240\u6709\u53ef\u7528\u7684\u6807\u7b7e&#xff0c;\u4f60\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u4e0d\u5e26\u53c2\u6570\u7684 git tag \u547d\u4ee4\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u8981\u5c06\u6807\u7b7e\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93&#xff0c;\u53ef\u4ee5\u4f7f\u7528 git push &#8211;tags \u547d\u4ee4\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">stash<\/span><\/p>\n<p><span style=\"color:#000000\">Git stash \u662f Git \u4e2d\u4e00\u4e2a\u5f3a\u5927\u7684\u547d\u4ee4&#xff0c;\u5b83\u5141\u8bb8\u60a8\u6682\u65f6\u4fdd\u5b58\u5bf9\u5de5\u4f5c\u76ee\u5f55\u6240\u505a\u7684\u66f4\u6539&#xff0c;\u800c\u8fd9\u4e9b\u66f4\u6539\u60a8\u76ee\u524d\u8fd8\u4e0d\u60f3\u63d0\u4ea4\u3002\u00a0\u5b83\u4f1a\u5c06\u60a8\u4fee\u6539\u8fc7\u7684\u5df2\u8ddf\u8e2a\u6587\u4ef6\u3001\u6682\u5b58\u7684\u53d8\u66f4\u4fdd\u5b58\u5230\u4e00\u4e2a\u672a\u5b8c\u6210\u66f4\u6539\u7684\u5806\u6808\u4e2d&#xff0c;\u60a8\u53ef\u4ee5\u968f\u65f6\u91cd\u65b0\u5e94\u7528\u8fd9\u4e9b\u66f4\u6539\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u4ee5\u4e0b\u662f\u6682\u5b58\u66f4\u6539\u7684\u65b9\u6cd5&#xff1a;<\/span><\/p>\n<p>git stash save &#034;Your stash message&#034;<\/p>\n<p><span style=\"color:#000000\">\u8981\u67e5\u770b\u6240\u6709\u6682\u5b58\u5217\u8868&#xff0c;\u53ef\u4ee5\u4f7f\u7528&#xff1a;<\/span><\/p>\n<p>git stash list<\/p>\n<p><span style=\"color:#000000\">\u8981\u91cd\u65b0\u5e94\u7528\u5b58\u50a8\u5728\u6682\u5b58\u4e2d\u7684\u66f4\u6539&#xff0c;\u53ef\u4ee5\u4f7f\u7528 git stash apply \u547d\u4ee4\u540e\u8ddf\u6682\u5b58\u540d\u79f0&#xff1a;<\/span><\/p>\n<p>git stash apply stash&#064;{0}<\/p>\n<p><span style=\"color:#000000\">\u64a4\u9500\u66f4\u6539<\/span><\/p>\n<p><span style=\"color:#000000\">git revert \u547d\u4ee4\u53ef\u7528\u4e8e\u64a4\u9500\u4ed3\u5e93\u63d0\u4ea4\u4e2d\u7684\u66f4\u6539\u3002\u00a0\u8fd9\u662f\u4e00\u79cd\u5b89\u5168\u7684\u64a4\u9500\u65b9\u5f0f&#xff0c;\u56e0\u4e3a\u5b83\u4e0d\u4f1a\u6539\u53d8\u73b0\u6709\u5386\u53f2\u8bb0\u5f55&#xff0c;\u800c\u662f\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u63d0\u4ea4\u6765\u64a4\u9500\u5148\u524d\u63d0\u4ea4\u4e2d\u7684\u66f4\u6539\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u8981\u64a4\u9500\u67d0\u4e2a\u63d0\u4ea4&#xff0c;\u60a8\u9700\u8981\u77e5\u9053\u5176\u54c8\u5e0c\u503c\u3002\u00a0\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b git log \u83b7\u53d6\u8be5\u54c8\u5e0c\u503c\u3002\u00a0\u83b7\u5f97\u54c8\u5e0c\u503c\u540e&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u64a4\u9500\u63d0\u4ea4&#xff1a;<\/span><\/p>\n<p>git revert [commit_hash]<\/p>\n<p><span style=\"color:#000000\">\u5728\u5b9e\u9645\u5e94\u7528\u4e2d&#xff0c;\u8fd9\u4e9b\u547d\u4ee4\u4e3a\u9879\u76ee\u5386\u53f2\u7684\u7ba1\u7406\u548c\u4fee\u6539\u63d0\u4f9b\u4e86\u7075\u6d3b\u6027\u3002\u00a0\u901a\u8fc7\u7406\u89e3\u6807\u7b7e\u3001\u50a8\u85cf\u548c\u64a4\u9500\u64cd\u4f5c&#xff0c;\u60a8\u80fd\u66f4\u597d\u5730\u5e94\u5bf9\u610f\u5916\u60c5\u51b5\u3001\u7ba1\u7406\u7248\u672c\u53d1\u5e03\u4ee5\u53ca\u7ef4\u62a4\u6e05\u6670\u6613\u61c2\u7684\u63d0\u4ea4\u5386\u53f2\u2014\u2014\u8fd9\u4e9b\u90fd\u662f\u540e\u7aef\u5f00\u53d1\u4eba\u5458\u7684\u5173\u952e\u6280\u80fd\u3002\u00a0\u8bf7\u59cb\u7ec8\u8bb0\u5f97&#xff0c;\u5728\u6267\u884c\u8fd9\u4e9b Git \u547d\u4ee4\u540e\u8981\u5168\u9762\u6d4b\u8bd5\u6240\u6709\u66f4\u6539&#xff0c;\u4ee5\u786e\u4fdd\u4ee3\u7801\u5e93\u4fdd\u6301\u7a33\u5b9a\u548c\u529f\u80fd\u6b63\u5e38\u3002<\/span><\/p>\n<h2 id=\"aid_262\" style=\"text-align:justify\"><span style=\"color:#000000\">\u603b\u7ed3<\/span><\/h2>\n<p><span style=\"color:#000000\">\u672c\u7ae0\u6df1\u5165\u63a2\u8ba8\u4e86\u7248\u672c\u63a7\u5236\u7684\u91cd\u8981\u6027&#xff0c;\u4ee5\u53ca Git \u8fd9\u4e00\u6700\u6d41\u884c\u7684\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u5982\u4f55\u6210\u4e3a\u540e\u7aef\u7f16\u7a0b\u4e0d\u53ef\u6216\u7f3a\u7684\u7ec4\u6210\u90e8\u5206\u3002\u00a0\u6211\u4eec\u4e86\u89e3\u5230&#xff0c;\u50cf Git \u8fd9\u6837\u7684\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u63d0\u4f9b\u4e86\u8ffd\u8e2a\u53d8\u66f4\u3001\u4e0e\u5176\u4ed6\u5f00\u53d1\u8005\u534f\u4f5c\u4ee5\u53ca\u7ba1\u7406\u4ee3\u7801\u4e0d\u540c\u7248\u672c\u7684\u7ed3\u6784\u5316\u65b9\u6cd5&#xff0c;\u8fd9\u4e9b\u5bf9\u4e8e\u540e\u7aef\u7cfb\u7edf\u7b49\u5927\u89c4\u6a21\u590d\u6742\u5f00\u53d1\u9879\u76ee\u90fd\u81f3\u5173\u91cd\u8981\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u6211\u4eec\u9996\u5148\u5728 C&#043;&#043;\u73af\u5883\u4e2d\u914d\u7f6e\u4e86 Git&#xff0c;\u8fc8\u51fa\u4e86\u6709\u6548\u7248\u672c\u7ba1\u7406\u7684\u7b2c\u4e00\u6b65\u3002\u00a0\u901a\u8fc7\u5b66\u4e60\u57fa\u672c Git \u547d\u4ee4&#xff0c;\u6211\u4eec\u7406\u89e3\u4e86\u5b83\u4eec\u5728\u5de5\u4f5c\u6d41\u4e2d\u5982\u4f55\u7528\u4e8e\u8ffd\u8e2a\u3001\u6682\u5b58\u548c\u63d0\u4ea4\u53d8\u66f4\u3002\u00a0\u901a\u8fc7\u6df1\u5165\u5206\u652f\u4e0e\u5408\u5e76\u6982\u5ff5&#xff0c;\u8fd9\u4e9b\u77e5\u8bc6\u5f97\u5230\u8fdb\u4e00\u6b65\u5f3a\u5316&#xff0c;\u91cd\u70b9\u9610\u8ff0\u4e86\u5b83\u4eec\u5982\u4f55\u5728\u4e0d\u5f71\u54cd\u4e3b\u4ee3\u7801\u5e93\u7684\u60c5\u51b5\u4e0b\u4fc3\u8fdb\u5e76\u884c\u5f00\u53d1\u3002\u00a0\u6211\u4eec\u8ba4\u8bc6\u5230&#xff0c;\u6709\u6548\u4f7f\u7528 Git \u6709\u52a9\u4e8e\u7ef4\u62a4\u6e05\u6670\u53ef\u63a7\u7684\u4ee3\u7801\u5386\u53f2\u8bb0\u5f55\u3002<\/span><\/p>\n<p><span style=\"color:#000000\">\u63a5\u4e0b\u6765&#xff0c;\u6211\u4eec\u4ecb\u7ecd\u4e86 GitHub\u2014\u2014\u4e00\u4e2a\u6258\u7ba1 Git \u4ed3\u5e93\u7684\u5e73\u53f0&#xff0c;\u5b83\u6781\u5927\u5730\u62d3\u5c55\u4e86\u534f\u4f5c\u5f00\u53d1\u7684\u53ef\u80fd\u6027\u3002\u00a0\u6211\u4eec\u7814\u7a76\u4e86 GitHub \u4ed3\u5e93&#xff0c;\u638c\u63e1\u4e86\u5982\u4f55 fork\u3001clone \u4ee5\u53ca\u7ba1\u7406\u8fd9\u4e9b\u5728\u7ebf\u4ee3\u7801\u7248\u672c\u3002\u00a0\u7136\u540e\u6211\u4eec\u6df1\u5165\u63a2\u8ba8\u4e86 pull request \u8fd9\u4e2a\u534f\u4f5c\u7f16\u7a0b\u7684\u6838\u5fc3\u673a\u5236&#xff0c;\u4e86\u89e3\u4e86\u5b83\u5982\u4f55\u5e2e\u52a9\u5f00\u53d1\u8005\u63d0\u8bae\u4ee3\u7801\u53d8\u66f4\u5e76\u4fc3\u8fdb\u6280\u672f\u8ba8\u8bba\u3002\u00a0\u6700\u540e&#xff0c;\u6211\u4eec\u5b66\u4e60\u4e86 Git \u7684\u9ad8\u7ea7\u7528\u6cd5&#xff0c;\u5305\u62ec\u6807\u7b7e\u7ba1\u7406\u3001\u6682\u5b58\u4fee\u6539\u548c\u7248\u672c\u56de\u9000&#xff0c;\u8fd9\u4e9b\u547d\u4ee4\u4e3a\u6211\u4eec\u7ba1\u7406\u4ee3\u7801\u63d0\u4f9b\u4e86\u66f4\u5f3a\u5927\u7684\u7075\u6d3b\u6027\u548c\u63a7\u5236\u529b\u3002\u00a0\u901a\u8fc7\u672c\u7ae0\u7684\u5b66\u4e60&#xff0c;\u6211\u4eec\u5df2\u7ecf\u638c\u63e1\u4e86\u4f7f\u7528 Git \u548c GitHub \u9ad8\u6548\u7ba1\u7406\u7ef4\u62a4\u540e\u7aef\u4ee3\u7801\u7684\u5173\u952e\u6280\u80fd\u3002<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.7k\u6b21\uff0c\u70b9\u8d5e45\u6b21\uff0c\u6536\u85cf15\u6b21\u3002\u6700\u540e\uff0c\u6211\u4eec\u5b66\u4e60\u4e86 Git \u7684\u9ad8\u7ea7\u7528\u6cd5\uff0c\u5305\u62ec\u6807\u7b7e\u7ba1\u7406\u3001\u6682\u5b58\u4fee\u6539\u548c\u7248\u672c\u56de\u9000\uff0c\u8fd9\u4e9b\u547d\u4ee4\u4e3a\u6211\u4eec\u7ba1\u7406\u4ee3\u7801\u63d0\u4f9b\u4e86\u66f4\u5f3a\u5927\u7684\u7075\u6d3b\u6027\u548c\u63a7\u5236\u529b\u3002\u6211\u4eec\u4e86\u89e3\u5230\uff0c\u50cf Git \u8fd9\u6837\u7684\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u63d0\u4f9b\u4e86\u8ffd\u8e2a\u53d8\u66f4\u3001\u4e0e\u5176\u4ed6\u5f00\u53d1\u8005\u534f\u4f5c\u4ee5\u53ca\u7ba1\u7406\u4ee3\u7801\u4e0d\u540c\u7248\u672c\u7684\u7ed3\u6784\u5316\u65b9\u6cd5\uff0c\u8fd9\u4e9b\u5bf9\u4e8e\u540e\u7aef\u7cfb\u7edf\u7b49\u5927\u89c4\u6a21\u590d\u6742\u5f00\u53d1\u9879\u76ee\u90fd\u81f3\u5173\u91cd\u8981\u3002Git stash \u662f Git \u4e2d\u4e00\u4e2a\u5f3a\u5927\u7684\u547d\u4ee4\uff0c\u5b83\u5141\u8bb8\u60a8\u6682\u65f6\u4fdd\u5b58\u5bf9\u5de5\u4f5c\u76ee\u5f55\u6240\u505a\u7684\u66f4\u6539\uff0c\u800c\u8fd9\u4e9b\u66f4\u6539\u60a8\u76ee\u524d\u8fd8\u4e0d\u60f3\u63d0\u4ea4\u3002\u5b83\u4f1a\u5c06\u60a8\u4fee\u6539\u8fc7\u7684\u5df2\u8ddf\u8e2a\u6587\u4ef6\u3001\u6682\u5b58\u7684\u53d8\u66f4\u4fdd\u5b58\u5230\u4e00\u4e2a\u672a\u5b8c\u6210\u66f4\u6539\u7684\u5806\u6808\u4e2d\uff0c\u60a8\u53ef\u4ee5\u968f\u65f6\u91cd\u65b0\u5e94\u7528\u8fd9\u4e9b\u66f4\u6539\u3002_git com.xingin<\/p>\n","protected":false},"author":2,"featured_media":48729,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[4489,89,92],"topic":[],"class_list":["post-48732","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-c","tag-git","tag-github"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>C++\u540e\u7aef\u7f16\u7a0b \u6784\u5efa\u9ad8\u6027\u80fd\u540e\u7aef\u7684\u6570\u636e\u5e93\u3001API \u4e0e Web \u670d\u52a1\u5668 4 \u7cbe\u901a\u7248\u672c\u63a7\u5236\u2014\u2014Git \u4e0e GitHub - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/48732.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C++\u540e\u7aef\u7f16\u7a0b \u6784\u5efa\u9ad8\u6027\u80fd\u540e\u7aef\u7684\u6570\u636e\u5e93\u3001API \u4e0e Web \u670d\u52a1\u5668 4 \u7cbe\u901a\u7248\u672c\u63a7\u5236\u2014\u2014Git \u4e0e GitHub - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.7k\u6b21\uff0c\u70b9\u8d5e45\u6b21\uff0c\u6536\u85cf15\u6b21\u3002\u6700\u540e\uff0c\u6211\u4eec\u5b66\u4e60\u4e86 Git \u7684\u9ad8\u7ea7\u7528\u6cd5\uff0c\u5305\u62ec\u6807\u7b7e\u7ba1\u7406\u3001\u6682\u5b58\u4fee\u6539\u548c\u7248\u672c\u56de\u9000\uff0c\u8fd9\u4e9b\u547d\u4ee4\u4e3a\u6211\u4eec\u7ba1\u7406\u4ee3\u7801\u63d0\u4f9b\u4e86\u66f4\u5f3a\u5927\u7684\u7075\u6d3b\u6027\u548c\u63a7\u5236\u529b\u3002\u6211\u4eec\u4e86\u89e3\u5230\uff0c\u50cf Git \u8fd9\u6837\u7684\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u63d0\u4f9b\u4e86\u8ffd\u8e2a\u53d8\u66f4\u3001\u4e0e\u5176\u4ed6\u5f00\u53d1\u8005\u534f\u4f5c\u4ee5\u53ca\u7ba1\u7406\u4ee3\u7801\u4e0d\u540c\u7248\u672c\u7684\u7ed3\u6784\u5316\u65b9\u6cd5\uff0c\u8fd9\u4e9b\u5bf9\u4e8e\u540e\u7aef\u7cfb\u7edf\u7b49\u5927\u89c4\u6a21\u590d\u6742\u5f00\u53d1\u9879\u76ee\u90fd\u81f3\u5173\u91cd\u8981\u3002Git stash \u662f Git \u4e2d\u4e00\u4e2a\u5f3a\u5927\u7684\u547d\u4ee4\uff0c\u5b83\u5141\u8bb8\u60a8\u6682\u65f6\u4fdd\u5b58\u5bf9\u5de5\u4f5c\u76ee\u5f55\u6240\u505a\u7684\u66f4\u6539\uff0c\u800c\u8fd9\u4e9b\u66f4\u6539\u60a8\u76ee\u524d\u8fd8\u4e0d\u60f3\u63d0\u4ea4\u3002\u5b83\u4f1a\u5c06\u60a8\u4fee\u6539\u8fc7\u7684\u5df2\u8ddf\u8e2a\u6587\u4ef6\u3001\u6682\u5b58\u7684\u53d8\u66f4\u4fdd\u5b58\u5230\u4e00\u4e2a\u672a\u5b8c\u6210\u66f4\u6539\u7684\u5806\u6808\u4e2d\uff0c\u60a8\u53ef\u4ee5\u968f\u65f6\u91cd\u65b0\u5e94\u7528\u8fd9\u4e9b\u66f4\u6539\u3002_git com.xingin\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/48732.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-30T05:12:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730051239-6889a9c72351c.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/48732.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/48732.html\",\"name\":\"C++\u540e\u7aef\u7f16\u7a0b \u6784\u5efa\u9ad8\u6027\u80fd\u540e\u7aef\u7684\u6570\u636e\u5e93\u3001API \u4e0e Web \u670d\u52a1\u5668 4 \u7cbe\u901a\u7248\u672c\u63a7\u5236\u2014\u2014Git \u4e0e GitHub - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-07-30T05:12:40+00:00\",\"dateModified\":\"2025-07-30T05:12:40+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/48732.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/48732.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/48732.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C++\u540e\u7aef\u7f16\u7a0b \u6784\u5efa\u9ad8\u6027\u80fd\u540e\u7aef\u7684\u6570\u636e\u5e93\u3001API \u4e0e Web \u670d\u52a1\u5668 4 \u7cbe\u901a\u7248\u672c\u63a7\u5236\u2014\u2014Git \u4e0e GitHub\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C++\u540e\u7aef\u7f16\u7a0b \u6784\u5efa\u9ad8\u6027\u80fd\u540e\u7aef\u7684\u6570\u636e\u5e93\u3001API \u4e0e Web \u670d\u52a1\u5668 4 \u7cbe\u901a\u7248\u672c\u63a7\u5236\u2014\u2014Git \u4e0e GitHub - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/48732.html","og_locale":"zh_CN","og_type":"article","og_title":"C++\u540e\u7aef\u7f16\u7a0b \u6784\u5efa\u9ad8\u6027\u80fd\u540e\u7aef\u7684\u6570\u636e\u5e93\u3001API \u4e0e Web \u670d\u52a1\u5668 4 \u7cbe\u901a\u7248\u672c\u63a7\u5236\u2014\u2014Git \u4e0e GitHub - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.7k\u6b21\uff0c\u70b9\u8d5e45\u6b21\uff0c\u6536\u85cf15\u6b21\u3002\u6700\u540e\uff0c\u6211\u4eec\u5b66\u4e60\u4e86 Git \u7684\u9ad8\u7ea7\u7528\u6cd5\uff0c\u5305\u62ec\u6807\u7b7e\u7ba1\u7406\u3001\u6682\u5b58\u4fee\u6539\u548c\u7248\u672c\u56de\u9000\uff0c\u8fd9\u4e9b\u547d\u4ee4\u4e3a\u6211\u4eec\u7ba1\u7406\u4ee3\u7801\u63d0\u4f9b\u4e86\u66f4\u5f3a\u5927\u7684\u7075\u6d3b\u6027\u548c\u63a7\u5236\u529b\u3002\u6211\u4eec\u4e86\u89e3\u5230\uff0c\u50cf Git \u8fd9\u6837\u7684\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u63d0\u4f9b\u4e86\u8ffd\u8e2a\u53d8\u66f4\u3001\u4e0e\u5176\u4ed6\u5f00\u53d1\u8005\u534f\u4f5c\u4ee5\u53ca\u7ba1\u7406\u4ee3\u7801\u4e0d\u540c\u7248\u672c\u7684\u7ed3\u6784\u5316\u65b9\u6cd5\uff0c\u8fd9\u4e9b\u5bf9\u4e8e\u540e\u7aef\u7cfb\u7edf\u7b49\u5927\u89c4\u6a21\u590d\u6742\u5f00\u53d1\u9879\u76ee\u90fd\u81f3\u5173\u91cd\u8981\u3002Git stash \u662f Git \u4e2d\u4e00\u4e2a\u5f3a\u5927\u7684\u547d\u4ee4\uff0c\u5b83\u5141\u8bb8\u60a8\u6682\u65f6\u4fdd\u5b58\u5bf9\u5de5\u4f5c\u76ee\u5f55\u6240\u505a\u7684\u66f4\u6539\uff0c\u800c\u8fd9\u4e9b\u66f4\u6539\u60a8\u76ee\u524d\u8fd8\u4e0d\u60f3\u63d0\u4ea4\u3002\u5b83\u4f1a\u5c06\u60a8\u4fee\u6539\u8fc7\u7684\u5df2\u8ddf\u8e2a\u6587\u4ef6\u3001\u6682\u5b58\u7684\u53d8\u66f4\u4fdd\u5b58\u5230\u4e00\u4e2a\u672a\u5b8c\u6210\u66f4\u6539\u7684\u5806\u6808\u4e2d\uff0c\u60a8\u53ef\u4ee5\u968f\u65f6\u91cd\u65b0\u5e94\u7528\u8fd9\u4e9b\u66f4\u6539\u3002_git com.xingin","og_url":"https:\/\/www.wsisp.com\/helps\/48732.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-07-30T05:12:40+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730051239-6889a9c72351c.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/48732.html","url":"https:\/\/www.wsisp.com\/helps\/48732.html","name":"C++\u540e\u7aef\u7f16\u7a0b \u6784\u5efa\u9ad8\u6027\u80fd\u540e\u7aef\u7684\u6570\u636e\u5e93\u3001API \u4e0e Web \u670d\u52a1\u5668 4 \u7cbe\u901a\u7248\u672c\u63a7\u5236\u2014\u2014Git \u4e0e GitHub - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-07-30T05:12:40+00:00","dateModified":"2025-07-30T05:12:40+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/48732.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/48732.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/48732.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"C++\u540e\u7aef\u7f16\u7a0b \u6784\u5efa\u9ad8\u6027\u80fd\u540e\u7aef\u7684\u6570\u636e\u5e93\u3001API \u4e0e Web \u670d\u52a1\u5668 4 \u7cbe\u901a\u7248\u672c\u63a7\u5236\u2014\u2014Git \u4e0e GitHub"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/48732","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=48732"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/48732\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/48729"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=48732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=48732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=48732"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=48732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}