{"id":39142,"date":"2025-05-22T08:21:15","date_gmt":"2025-05-22T00:21:15","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/39142.html"},"modified":"2025-05-22T08:21:15","modified_gmt":"2025-05-22T00:21:15","slug":"git-%e5%92%8c-github-%e5%ad%a6%e4%b9%a0%e6%8c%87%e5%8d%97%e6%9c%ac%e5%9c%b0-git-%e9%85%8d%e7%bd%ae%e3%80%81%e5%9f%ba%e7%a1%80%e5%91%bd%e4%bb%a4%e3%80%81github-%e4%b8%8a%e4%bc%a0%e6%b5%81%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/39142.html","title":{"rendered":"Git \u548c GitHub \u5b66\u4e60\u6307\u5357\u672c\u5730 Git \u914d\u7f6e\u3001\u57fa\u7840\u547d\u4ee4\u3001GitHub \u4e0a\u4f20\u6d41\u7a0b\u3001\u4f01\u4e1a\u5f00\u53d1\u4e2d Git \u7684\u4f7f\u7528\u6d41\u7a0b\u3001\u4ee5\u53ca\u5982\u4f55\u5c06\u4ee3\u7801\u90e8\u7f72\u5230\u751f\u4ea7\u670d\u52a1\u5668"},"content":{"rendered":"<h2>Windows \u4e0a Git \u5b89\u88c5\u4e0e\u914d\u7f6e<\/h2>\n<ul>\n<li>\n<p>\u4e0b\u8f7d\u5b89\u88c5&#xff1a;\u8bbf\u95ee Git \u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u9002\u7528\u4e8e Windows \u7684\u5b89\u88c5\u7a0b\u5e8f\u3002\u8fd0\u884c\u5b89\u88c5\u5305\u65f6\u4f1a\u51fa\u73b0\u8bb8\u53ef\u534f\u8bae\u3001\u5b89\u88c5\u76ee\u5f55\u3001\u7ec4\u4ef6\u9009\u62e9\u7b49\u754c\u9762&#xff08;\u5982\u4e0b\u56fe&#xff09;\u3002\u5728\u201cSelect Components\u201d\u9875\u9762\u5efa\u8bae\u52fe\u9009 Git Bash Here \u7b49\u9009\u9879&#xff0c;\u4ee5\u4fbf\u5728\u8d44\u6e90\u7ba1\u7406\u5668\u4e2d\u53f3\u952e\u5feb\u901f\u542f\u52a8 Git Bash\u301069\u2020\u3011\u3002 \u5b89\u88c5\u5b8c\u6210\u540e&#xff0c;\u53ef\u5728\u300c\u5f00\u59cb\u83dc\u5355\u300d\u6216\u684c\u9762&#xff08;\u5982\u679c\u52fe\u9009&#xff09;\u627e\u5230 Git Bash\u3002\u6253\u5f00 Git Bash \u540e&#xff0c;\u8f93\u5165 git &#8211;version \u53ef\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002<\/p>\n<\/li>\n<li>\n<p>\u914d\u7f6e\u5168\u5c40\u7528\u6237\u540d\u548c\u90ae\u7bb1&#xff1a;\u5b89\u88c5\u5b8c\u6210\u540e&#xff0c;\u9996\u5148\u914d\u7f6e Git \u7684\u8eab\u4efd\u4fe1\u606f&#xff0c;\u8fd9\u4e9b\u4fe1\u606f\u4f1a\u8bb0\u5f55\u5728\u6bcf\u6b21\u63d0\u4ea4\u4e2d\u3002\u5728 Git Bash \u4e2d\u8fd0\u884c&#xff1a;<\/p>\n<p> <span class=\"token function\">git<\/span> config <span class=\"token parameter variable\">&#8211;global<\/span> user.name <span class=\"token string\">&#034;\u4f60\u7684\u540d\u5b57&#034;<\/span><br \/>\n<span class=\"token function\">git<\/span> config <span class=\"token parameter variable\">&#8211;global<\/span> user.email yourEmail&#064;example.com<\/p>\n<p>\u6b64\u547d\u4ee4\u4f1a\u5c06\u7528\u6237\u540d\u548c\u90ae\u7bb1\u5199\u5165 ~\/.gitconfig&#xff08;Windows \u901a\u5e38\u4e3a C:\\\\Users\\\\\u7528\u6237\u540d\\\\.gitconfig&#xff09;\u3002\u4ee5\u540e\u65b0\u5efa\u7684\u4ed3\u5e93\u9ed8\u8ba4\u90fd\u4f1a\u4f7f\u7528\u8fd9\u4e2a\u8eab\u4efd\u4fe1\u606f&#xff0c;\u9664\u975e\u4e3a\u67d0\u4e2a\u9879\u76ee\u5355\u72ec\u91cd\u5199\u3002<\/p>\n<\/li>\n<li>\n<p>\u751f\u6210\u5e76\u914d\u7f6e SSH \u5bc6\u94a5&#xff1a;\u4e3a\u4e86\u5b89\u5168\u5730\u8fde\u63a5\u8fdc\u7a0b\u4ed3\u5e93&#xff08;\u5982 GitHub&#xff09;&#xff0c;\u63a8\u8350\u4f7f\u7528 SSH \u8ba4\u8bc1\u3002\u542f\u52a8 Git Bash&#xff0c;\u8fd0\u884c&#xff1a;<\/p>\n<p> ssh-keygen <span class=\"token parameter variable\">-t<\/span> rsa <span class=\"token parameter variable\">-b<\/span> <span class=\"token number\">4096<\/span> <span class=\"token parameter variable\">-C<\/span> <span class=\"token string\">&#034;\u4f60\u7684\u90ae\u7bb1&#034;<\/span><\/p>\n<p>\u6309\u63d0\u793a\u4e00\u8def\u56de\u8f66&#xff0c;\u65b0\u751f\u6210\u7684\u5bc6\u94a5\u6587\u4ef6\u9ed8\u8ba4\u4f4d\u4e8e ~\/.ssh\/id_rsa&#xff08;\u79c1\u94a5&#xff09;\u548c ~\/.ssh\/id_rsa.pub&#xff08;\u516c\u94a5&#xff09;\u3002\u7136\u540e\u8fd0\u884c ssh-agent \u5e76\u6dfb\u52a0\u79c1\u94a5&#xff1a;<\/p>\n<p> <span class=\"token builtin class-name\">eval<\/span> <span class=\"token string\">&#034;<span class=\"token variable\"><span class=\"token variable\">$(<\/span>ssh-agent <span class=\"token parameter variable\">-s<\/span><span class=\"token variable\">)<\/span><\/span>&#034;<\/span><br \/>\nssh-add ~\/.ssh\/id_rsa<\/p>\n<p>\u5c06\u516c\u94a5\u5185\u5bb9\u590d\u5236\u5230\u4f60\u7684 GitHub \u8d26\u6237&#xff08;GitHub \u7f51\u7ad9 \u2192 Settings \u2192 SSH keys&#xff09;\u4e2d&#xff0c;\u8fd9\u6837\u5c31\u53ef\u4ee5\u901a\u8fc7 SSH \u65b9\u5f0f\u8bbf\u95ee GitHub \u4e86\u3002SSH \u5bc6\u94a5\u7528\u4e8e\u5b89\u5168\u8ba4\u8bc1&#xff0c;\u4f7f\u5f97 Git \u53ef\u4ee5\u5728\u63a8\u9001\u6216\u62c9\u53d6\u4ee3\u7801\u65f6\u4f7f\u7528\u5bc6\u94a5\u800c\u975e\u4f20\u7edf\u5bc6\u7801\u3002<\/p>\n<\/li>\n<li>\n<p>\u6d4b\u8bd5 SSH \u8fde\u63a5&#xff1a;\u5728 Git Bash \u4e2d\u8fd0\u884c&#xff1a;<\/p>\n<p> <span class=\"token function\">ssh<\/span> <span class=\"token parameter variable\">-T<\/span> git&#064;github.com<\/p>\n<p>\u5982\u679c\u63d0\u793a Hi username! You&#039;ve successfully authenticated&#8230; \u8868\u793a\u5df2\u6210\u529f\u8fde\u63a5 GitHub\u3002\u82e5\u51fa\u73b0\u9519\u8bef&#xff0c;\u68c0\u67e5\u5bc6\u94a5\u662f\u5426\u6b63\u786e\u6dfb\u52a0&#xff0c;\u6216\u662f\u5426\u901a\u8fc7 ssh-add \u52a0\u8f7d\u4e86\u79c1\u94a5\u3002<\/p>\n<\/li>\n<\/ul>\n<h2>Git \u57fa\u7840\u547d\u4ee4\u6559\u7a0b<\/h2>\n<p>Git \u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u547d\u4ee4\u7528\u4e8e\u4ed3\u5e93\u7ba1\u7406\u4e0e\u65e5\u5e38\u5f00\u53d1\u3002\u4e0b\u9762\u5217\u51fa\u5e38\u7528\u547d\u4ee4\u53ca\u5176\u4f5c\u7528\u548c\u793a\u4f8b&#xff1a;<\/p>\n<ul>\n<li>\n<p>git init&#xff1a;\u5728\u5f53\u524d\u76ee\u5f55\u521d\u59cb\u5316\u4e00\u4e2a\u65b0\u7684 Git \u4ed3\u5e93\u3002\u5982\u679c\u60f3\u628a\u4e00\u4e2a\u5df2\u6709\u9879\u76ee\u7eb3\u5165\u7248\u672c\u63a7\u5236&#xff0c;\u5c31\u5728\u8be5\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u8fd0\u884c&#xff1a;<\/p>\n<p> <span class=\"token function\">git<\/span> init<\/p>\n<p>\u8fd9\u4f1a\u521b\u5efa\u4e00\u4e2a\u9690\u85cf\u7684 .git \u6587\u4ef6\u5939&#xff0c;\u8868\u793a\u6b64\u76ee\u5f55\u5df2\u88ab Git \u7ba1\u7406\u3002<\/p>\n<\/li>\n<li>\n<p>git clone &lt;\u4ed3\u5e93\u5730\u5740&gt;&#xff1a;\u4ece\u8fdc\u7a0b\u4ed3\u5e93\u590d\u5236&#xff08;\u514b\u9686&#xff09;\u5230\u672c\u5730\u65b0\u76ee\u5f55\u3002\u6bd4\u5982\u8981\u83b7\u53d6 GitHub \u4e0a\u7684\u9879\u76ee&#xff1a;<\/p>\n<p> <span class=\"token function\">git<\/span> clone git&#064;github.com:\u7528\u6237\u540d\/\u4ed3\u5e93\u540d.git<\/p>\n<p>\u514b\u9686\u64cd\u4f5c\u4f1a\u5728\u672c\u5730\u521b\u5efa\u4e00\u4e2a\u4e0e\u8fdc\u7a0b\u4ed3\u5e93\u76f8\u540c\u7684\u526f\u672c&#xff0c;\u901a\u5e38\u8fd9\u662f\u5f00\u53d1\u8005\u83b7\u53d6\u9879\u76ee\u4ee3\u7801\u7684\u6700\u5e38\u7528\u65b9\u5f0f\u3002<\/p>\n<\/li>\n<li>\n<p>git add &lt;\u6587\u4ef6&gt;&#xff1a;\u5c06\u5de5\u4f5c\u76ee\u5f55\u4e2d\u7684\u4fee\u6539\u6dfb\u52a0\u5230\u6682\u5b58\u533a\u3002\u6bd4\u5982\u6dfb\u52a0\u5f53\u524d\u76ee\u5f55\u4e0b\u6240\u6709\u6587\u4ef6&#xff1a;<\/p>\n<p> <span class=\"token function\">git<\/span> <span class=\"token function\">add<\/span> <span class=\"token builtin class-name\">.<\/span><\/p>\n<p>\u8be5\u547d\u4ee4\u4f1a\u628a\u6307\u5b9a\u6587\u4ef6\u7684\u5f53\u524d\u7248\u672c\u8bb0\u5f55\u5230\u6682\u5b58\u533a&#xff0c;\u7b49\u5f85\u63d0\u4ea4\u5230\u4ed3\u5e93\u4e2d\u3002\u5e38\u7528 . \u8868\u793a\u6240\u6709\u6587\u4ef6&#xff0c;\u4e5f\u53ef\u4ee5\u6307\u5b9a\u5177\u4f53\u6587\u4ef6\u6216\u76ee\u5f55\u3002<\/p>\n<\/li>\n<li>\n<p>git status&#xff1a;\u67e5\u770b\u5de5\u4f5c\u76ee\u5f55\u72b6\u6001&#xff0c;\u5305\u62ec\u5df2\u4fee\u6539\u3001\u5df2\u6682\u5b58\u4f46\u672a\u63d0\u4ea4\u7684\u6587\u4ef6\u7b49&#xff1a;<\/p>\n<p> <span class=\"token function\">git<\/span> status<\/p>\n<p>\u8fd0\u884c\u540e\u4f1a\u663e\u793a\u54ea\u4e9b\u6587\u4ef6\u5df2\u88ab\u4fee\u6539\u4f46\u672a\u52a0\u5165\u6682\u5b58\u533a\u3001\u54ea\u4e9b\u6587\u4ef6\u5df2\u6682\u5b58\u5f85\u63d0\u4ea4\u7b49\u4fe1\u606f\u3002\u901a\u8fc7 git status \u53ef\u4ee5\u786e\u8ba4\u5f53\u524d\u4ed3\u5e93\u72b6\u6001\u3002<\/p>\n<\/li>\n<li>\n<p>git commit -m &#034;\u63d0\u4ea4\u4fe1\u606f&#034;&#xff1a;\u5c06\u6682\u5b58\u533a\u7684\u5185\u5bb9\u4f5c\u4e3a\u4e00\u4e2a\u65b0\u5feb\u7167\u63d0\u4ea4\u5230\u4ed3\u5e93\u5386\u53f2\u3002<\/p>\n<p> <span class=\"token function\">git<\/span> commit <span class=\"token parameter variable\">-m<\/span> <span class=\"token string\">&#034;\u5b9e\u73b0\u4e86\u7528\u6237\u767b\u5f55\u529f\u80fd&#034;<\/span><\/p>\n<p>\u6bcf\u6b21\u63d0\u4ea4\u90fd\u4f1a\u751f\u6210\u4e00\u4e2a\u552f\u4e00\u7684\u63d0\u4ea4\u8bb0\u5f55&#xff0c;\u5305\u542b\u5f00\u53d1\u8005\u4fe1\u606f\u3001\u65f6\u95f4\u548c\u63d0\u4ea4\u8bf4\u660e\u3002git add \u52a0 git commit \u6784\u6210\u4e86 Git \u6700\u57fa\u672c\u7684\u5de5\u4f5c\u6d41\u3002<\/p>\n<\/li>\n<li>\n<p>git log&#xff1a;\u67e5\u770b\u63d0\u4ea4\u5386\u53f2&#xff1a;<\/p>\n<p> <span class=\"token function\">git<\/span> log<\/p>\n<p>\u5b83\u5217\u51fa\u4ed3\u5e93\u4e2d\u6240\u6709\u63d0\u4ea4\u7684\u5386\u53f2\u8bb0\u5f55&#xff0c;\u5305\u62ec\u63d0\u4ea4 ID\u3001\u4f5c\u8005\u3001\u65e5\u671f\u548c\u63d0\u4ea4\u4fe1\u606f\u3002\u53ef\u4ee5\u52a0 &#8211;oneline\u3001&#8211;graph \u7b49\u9009\u9879\u67e5\u770b\u66f4\u7b80\u6d01\u6216\u56fe\u5f62\u5316\u7684\u65e5\u5fd7\u3002<\/p>\n<\/li>\n<li>\n<p>git branch &lt;\u5206\u652f\u540d&gt;&#xff1a;\u521b\u5efa\u65b0\u5206\u652f\u3002<\/p>\n<p> <span class=\"token function\">git<\/span> branch feature-x<\/p>\n<p>\u8be5\u547d\u4ee4\u4f1a\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a feature-x \u7684\u65b0\u5206\u652f&#xff0c;\u5176\u5b9e\u662f\u5f00\u53d1\u4e00\u6761\u5e76\u884c\u7684\u63d0\u4ea4\u5386\u53f2\u7ebf\u3002\u7136\u540e\u53ef\u4ee5\u8fd0\u884c git checkout feature-x \u5207\u6362\u5230\u8be5\u5206\u652f\u8fdb\u884c\u5f00\u53d1\u3002\u4f7f\u7528\u5206\u652f\u53ef\u4ee5\u5b9e\u73b0\u5e76\u884c\u5f00\u53d1&#xff0c;\u5404\u5206\u652f\u4e4b\u95f4\u76f8\u4e92\u9694\u79bb&#xff0c;\u4e0d\u4f1a\u5e72\u6270\u4e3b\u5e72\u3002<\/p>\n<\/li>\n<li>\n<p>git merge &lt;\u5206\u652f&gt;&#xff1a;\u5c06\u6307\u5b9a\u5206\u652f\u7684\u4fee\u6539\u5408\u5e76\u5230\u5f53\u524d\u5206\u652f\u3002\u5047\u8bbe\u5728 main \u5206\u652f\u4e0a\u6267\u884c&#xff1a;<\/p>\n<p> <span class=\"token function\">git<\/span> merge feature-x<\/p>\n<p>Git \u4f1a\u628a feature-x \u5206\u652f\u7684\u6539\u52a8\u5408\u5e76\u5230 main \u5206\u652f\u4e2d\u3002\u5408\u5e76\u662f Git \u4e2d\u7684\u4e00\u4e2a\u5f3a\u5927\u529f\u80fd&#xff0c;\u7528\u4e8e\u5c06\u4e0d\u540c\u5206\u652f\u7684\u5f00\u53d1\u6210\u679c\u6574\u5408\u5728\u4e00\u8d77\u3002\u5408\u5e76\u540e\u53ef\u80fd\u4f1a\u51fa\u73b0\u51b2\u7a81&#xff0c;\u9700\u8981\u624b\u5de5\u89e3\u51b3&#xff08;\u53c2\u89c1\u4e0b\u6587&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>git pull&#xff1a;\u81ea\u52a8\u5316\u5730\u4ece\u8fdc\u7a0b\u83b7\u53d6\u5e76\u5408\u5e76\u4ee3\u7801\u3002\u6267\u884c&#xff1a;<\/p>\n<p> <span class=\"token function\">git<\/span> pull origin main<\/p>\n<p>\u8be5\u547d\u4ee4\u4f1a\u5148\u4ece\u8fdc\u7a0b\u4ed3\u5e93&#xff08;\u5982 origin&#xff09;\u62c9\u53d6\u6307\u5b9a\u5206\u652f&#xff08;\u5982 main&#xff09;\u7684\u66f4\u65b0&#xff0c;\u7136\u540e\u7acb\u5373\u5408\u5e76\u5230\u5f53\u524d\u5206\u652f&#xff0c;\u5c31\u50cf git fetch \u52a0 git merge \u7684\u7b80\u5199\u3002\u901a\u5e38\u5728\u5f00\u59cb\u5de5\u4f5c\u524d\u8fd0\u884c git pull&#xff0c;\u786e\u4fdd\u672c\u5730\u4e0e\u8fdc\u7a0b\u540c\u6b65\u3002<\/p>\n<\/li>\n<li>\n<p>git push&#xff1a;\u5c06\u672c\u5730\u5206\u652f\u7684\u63d0\u4ea4\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\u3002\u4e00\u822c\u683c\u5f0f\u4e3a&#xff1a;<\/p>\n<p> <span class=\"token function\">git<\/span> push origin main<\/p>\n<p>\u5176\u4e2d origin \u662f\u8fdc\u7a0b\u4ed3\u5e93\u522b\u540d&#xff0c;main \u662f\u5206\u652f\u540d\u3002\u6b64\u64cd\u4f5c\u4f1a\u628a\u672c\u5730 main \u5206\u652f\u7684\u6700\u65b0\u63d0\u4ea4\u4e0a\u4f20\u5230 GitHub \u7b49\u8fdc\u7a0b\u4ed3\u5e93\u3002\u901a\u5e38\u9996\u6b21\u63a8\u9001\u8fd8\u9700\u8981\u52a0\u4e0a -u \u53c2\u6570&#xff0c;\u5982 git push -u origin main&#xff0c;\u4ee5\u5c06\u8fdc\u7a0b\u5206\u652f\u8bbe\u7f6e\u4e3a\u4e0a\u6e38\u5206\u652f\u3002<\/p>\n<\/li>\n<li>\n<p>git stash&#xff1a;\u6682\u5b58\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u672a\u63d0\u4ea4\u7684\u4fee\u6539&#xff0c;\u4ee5\u4fbf\u5207\u6362\u5206\u652f\u6216\u4e34\u65f6\u5904\u7406\u5176\u4ed6\u4e8b\u52a1\u3002\u4f7f\u7528\u65b9\u6cd5&#xff1a;<\/p>\n<p> <span class=\"token function\">git<\/span> stash<\/p>\n<p>\u8be5\u547d\u4ee4\u4f1a\u628a\u6240\u6709\u672a\u63d0\u4ea4\u7684\u6539\u52a8&#xff08;\u5305\u62ec\u5df2\u6682\u5b58\u548c\u672a\u6682\u5b58\u7684&#xff09;\u90fd\u4fdd\u5b58\u5230\u4e00\u4e2a\u6808\u4e2d&#xff0c;\u5e76\u6062\u590d\u5de5\u4f5c\u76ee\u5f55\u5230\u5e72\u51c0\u72b6\u6001\u3002\u4e4b\u540e\u53ef\u4ee5\u4f7f\u7528 git stash pop \u6062\u590d\u8fd9\u4e9b\u6539\u52a8\u3002\u8fd9\u5bf9\u4e2d\u65ad\u5f53\u524d\u5de5\u4f5c\u53bb\u5904\u7406\u5176\u4ed6\u7d27\u6025\u4efb\u52a1\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/li>\n<\/ul>\n<h2>\u5c06\u672c\u5730\u9879\u76ee\u4e0a\u4f20\u5230 GitHub<\/h2>\n<li>\n<p>\u5728\u672c\u5730\u9879\u76ee\u6839\u76ee\u5f55\u6267\u884c&#xff1a;<\/p>\n<p> <span class=\"token function\">git<\/span> init<br \/>\n<span class=\"token function\">git<\/span> <span class=\"token function\">add<\/span> <span class=\"token builtin class-name\">.<\/span><br \/>\n<span class=\"token function\">git<\/span> commit <span class=\"token parameter variable\">-m<\/span> <span class=\"token string\">&#034;\u9996\u6b21\u63d0\u4ea4&#034;<\/span><\/p>\n<p>\u8fd9\u4f1a\u628a\u5f53\u524d\u9879\u76ee\u521d\u59cb\u5316\u6210 Git \u4ed3\u5e93&#xff0c;\u5e76\u5c06\u6240\u6709\u6587\u4ef6\u63d0\u4ea4\u4e3a\u7b2c\u4e00\u4e2a\u7248\u672c\u3002<\/p>\n<\/li>\n<li>\n<p>\u5728 GitHub \u7f51\u7ad9\u4e0a\u65b0\u5efa\u4e00\u4e2a\u7a7a\u7684\u4ed3\u5e93&#xff08;Repository&#xff09;&#xff0c;\u8bb0\u5f55\u4e0b\u4ed3\u5e93\u7684 SSH \u5730\u5740&#xff08;\u5982 git&#064;github.com:\u7528\u6237\u540d\/\u4ed3\u5e93\u540d.git&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>\u672c\u5730\u6dfb\u52a0\u8fdc\u7a0b\u4ed3\u5e93\u5730\u5740\u5e76\u63a8\u9001&#xff1a;<\/p>\n<p> <span class=\"token function\">git<\/span> remote <span class=\"token function\">add<\/span> origin git&#064;github.com:\u7528\u6237\u540d\/\u4ed3\u5e93\u540d.git<br \/>\n<span class=\"token function\">git<\/span> branch <span class=\"token parameter variable\">-M<\/span> main    <span class=\"token comment\"># \u5c06\u672c\u5730\u9ed8\u8ba4\u5206\u652f\u540d\u6539\u4e3a main&#xff08;\u53ef\u9009&#xff09;<\/span><br \/>\n<span class=\"token function\">git<\/span> push <span class=\"token parameter variable\">-u<\/span> origin main<\/p>\n<ul>\n<li>git remote add origin &lt;URL&gt; \u7528\u4e8e\u6dfb\u52a0\u8fdc\u7a0b\u4ed3\u5e93\u522b\u540d origin\u3002<\/li>\n<li>git branch -M main \u5c06\u5f53\u524d\u5206\u652f\u91cd\u547d\u540d\u4e3a main&#xff08;\u5982\u679c\u9ed8\u8ba4\u662f master&#xff09;\u4ee5\u4e0e GitHub \u4e0a\u7684\u9ed8\u8ba4\u5206\u652f\u540d\u4e00\u81f4\u3002<\/li>\n<li>git push -u origin main \u5c06\u672c\u5730\u7684 main \u5206\u652f\u63a8\u9001\u5230\u8fdc\u7a0b\u7684 main \u5206\u652f\u3002\u6267\u884c\u540e&#xff0c;GitHub \u4e0a\u5c31\u4f1a\u51fa\u73b0\u9879\u76ee\u7684\u6587\u4ef6\u5217\u8868\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6b64\u540e\u6bcf\u6b21\u66f4\u65b0\u4ee3\u7801\u540e&#xff0c;\u4f7f\u7528 git add\u3001git commit \u63d0\u4ea4&#xff0c;\u518d\u8fd0\u884c git push origin main \u5c06\u6539\u52a8\u540c\u6b65\u5230 GitHub\u3002\u7b2c\u4e00\u6b21 push \u540e\u5df2\u7ecf\u6307\u5b9a\u4e86\u4e0a\u6e38\u5206\u652f&#xff0c;\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 git push\u3002<\/p>\n<\/li>\n<h2>\u4f01\u4e1a\u7ea7\u5f00\u53d1\u4e2d\u7684 Git \u534f\u4f5c\u6d41\u7a0b<\/h2>\n<ul>\n<li>\n<p>\u529f\u80fd\u5206\u652f\u5de5\u4f5c\u6d41&#xff1a;\u56e2\u961f\u901a\u5e38\u91c7\u7528 Feature Branch&#xff08;\u529f\u80fd\u5206\u652f&#xff09;\u5de5\u4f5c\u6d41&#xff0c;\u5373\u65b0\u529f\u80fd\u5728\u5355\u72ec\u7684\u5206\u652f&#xff08;\u5982 feature\/login&#xff09;\u4e0a\u5f00\u53d1&#xff0c;\u5b8c\u6210\u540e\u901a\u8fc7 Pull Request \u5408\u5e76\u5230\u4e3b\u5e72&#xff08;main&#xff09;\u3002\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u4e3b\u5e72\u59cb\u7ec8\u4fdd\u6301\u53ef\u8fd0\u884c\u72b6\u6001&#xff0c;\u540c\u65f6\u591a\u4e2a\u5f00\u53d1\u8005\u53ef\u4ee5\u5e76\u884c\u5de5\u4f5c\u800c\u4e92\u4e0d\u5e72\u6270\u3002\u4e0b\u56fe\u793a\u610f\u4e86\u4e00\u4e2a\u5178\u578b\u7684\u529f\u80fd\u5206\u652f\u6d41\u7a0b&#xff1a;\u5f00\u53d1\u8005\u4ece\u4e3b\u5e72\u6216\u5f00\u53d1\u5206\u652f\u5207\u51fa\u65b0\u5206\u652f&#xff0c;\u5b8c\u6210\u540e\u5408\u5e76\u56de\u4e3b\u5e72\u3002<\/p>\n<\/li>\n<li>\n<p>Gitflow \u5de5\u4f5c\u6d41&#xff1a;\u5bf9\u4e8e\u53d1\u5e03\u5468\u671f\u8f83\u957f\u6216\u7248\u672c\u7ba1\u7406\u4e25\u683c\u7684\u9879\u76ee&#xff0c;\u53ef\u91c7\u7528 Gitflow \u5206\u652f\u6a21\u578b\u3002Gitflow \u5728 main&#xff08;\u53d1\u5e03&#xff09;\u548c develop&#xff08;\u5f00\u53d1&#xff09;\u4e24\u4e2a\u957f\u671f\u5206\u652f\u57fa\u7840\u4e0a&#xff0c;\u521b\u5efa\u66f4\u591a\u77ed\u671f\u5206\u652f&#xff1a;\u6bcf\u4e2a\u529f\u80fd\u65b0\u5efa feature\/* \u5206\u652f\u4ece develop \u5206\u51fa\u6765&#xff0c;\u5f00\u53d1\u5b8c\u6210\u540e\u5408\u5e76\u56de develop&#xff1b;\u53d1\u5e03\u65f6\u4ece develop \u5206\u51fa release\/* \u5206\u652f\u8fdb\u884c\u6700\u7ec8\u6d4b\u8bd5&#xff0c;\u518d\u5408\u5e76\u5230 main \u5e76\u6253\u6807\u7b7e&#xff1b;\u751f\u4ea7\u73af\u5883\u53d1\u73b0\u95ee\u9898\u65f6\u4ece main \u5206\u51fa hotfix\/* \u5206\u652f\u4fee\u590d\u540e\u518d\u5408\u5e76\u56de main \u548c develop\u3002Gitflow \u660e\u786e\u4e86\u5404\u7c7b\u5206\u652f\u7684\u804c\u8d23&#xff0c;\u9002\u5408\u9700\u8981\u4e25\u683c\u7248\u672c\u63a7\u5236\u7684\u5927\u578b\u9879\u76ee\u3002<\/p>\n<\/li>\n<li>\n<p>\u591a\u4eba\u534f\u4f5c\u4e0e\u5206\u652f\u7ba1\u7406&#xff1a;\u5728\u56e2\u961f\u534f\u4f5c\u65f6&#xff0c;\u5e94\u7edf\u4e00\u5206\u652f\u547d\u540d\u89c4\u8303&#xff08;\u5982 feature\/\u529f\u80fd\u540d\u3001bugfix\/\u7f16\u53f7 \u7b49&#xff09;&#xff0c;\u5e76\u5b9a\u671f\u540c\u6b65\u4e3b\u5e72\u53d8\u66f4\u3002\u6bcf\u4f4d\u5f00\u53d1\u8005\u90fd\u4ece\u8fdc\u7a0b\u4ed3\u5e93\u514b\u9686\u9879\u76ee\u540e\u521b\u5efa\u672c\u5730\u5206\u652f\u8fdb\u884c\u5f00\u53d1\u3002\u4f7f\u7528 git pull \u4fdd\u6301\u4e0e\u4e3b\u5e72\u4e00\u81f4&#xff0c;\u907f\u514d\u5206\u652f\u5dee\u5f02\u8fc7\u5927\u5bfc\u81f4\u51b2\u7a81\u3002<\/p>\n<\/li>\n<li>\n<p>\u4ee3\u7801\u8bc4\u5ba1&#xff08;Pull Request&#xff09;&#xff1a;\u5927\u591a\u6570\u56e2\u961f\u901a\u8fc7 GitHub\u3001GitLab \u6216 Bitbucket \u7b49\u5e73\u53f0\u53d1\u8d77 Pull Request&#xff08;\u62c9\u53d6\u8bf7\u6c42&#xff09; \u6765\u5ba1\u67e5\u4ee3\u7801\u3002\u5728 Pull Request \u4e2d&#xff0c;\u5f00\u53d1\u8005\u53ef\u4ee5\u9080\u8bf7\u540c\u4e8b\u5bf9\u81ea\u5df1\u7684\u6539\u52a8\u8fdb\u884c review&#xff0c;\u8ba8\u8bba\u5e76\u63d0\u51fa\u6539\u8fdb\u610f\u89c1&#xff0c;\u518d\u5408\u5e76\u5230\u4e3b\u5e72\u3002\u5ba1\u6838\u65f6\u53ef\u4ee5\u67e5\u770b\u6539\u52a8\u7684 diff\u3001\u8fd0\u884c\u81ea\u52a8\u5316\u6d4b\u8bd5\u72b6\u6001\u7b49&#xff0c;\u786e\u4fdd\u4ee3\u7801\u8d28\u91cf\u3002\u6b63\u5982\u77e5\u540d\u7ecf\u9a8c\u6240\u8ff0&#xff0c;\u201cPull requests \u63d0\u4f9b\u4e86\u4e00\u79cd\u4ece\u540c\u4e8b\u90a3\u91cc\u8bf7\u6c42\u4ee3\u7801\u5ba1\u67e5\u7684\u65b9\u6cd5&#xff0c;\u5e76\u68c0\u67e5\u6700\u8fd1\u4e00\u6b21\u63d0\u4ea4\u7684\u6784\u5efa\u72b6\u6001\u201d\u3002<\/p>\n<\/li>\n<li>\n<p>\u51b2\u7a81\u89e3\u51b3&#xff1a;\u5408\u5e76\u5206\u652f\u65f6\u53ef\u80fd\u9047\u5230 \u51b2\u7a81&#xff0c;\u5373\u4e0d\u540c\u5206\u652f\u5728\u540c\u4e00\u6587\u4ef6\u540c\u4e00\u4f4d\u7f6e\u505a\u4e86\u4e0d\u540c\u4fee\u6539\u3002Git \u65e0\u6cd5\u81ea\u52a8\u5408\u5e76\u6b64\u7c7b\u51b2\u7a81&#xff0c;\u9700\u8981\u4eba\u5de5\u4ecb\u5165\u3002\u901a\u5e38\u7684\u505a\u6cd5\u662f\u6253\u5f00\u51b2\u7a81\u6587\u4ef6&#xff0c;\u624b\u52a8\u7f16\u8f91\u4fdd\u7559\u6b63\u786e\u7684\u4ee3\u7801&#xff0c;\u5220\u9664\u51b2\u7a81\u6807\u8bb0&#xff0c;\u7136\u540e\u4f7f\u7528 git add \u6807\u8bb0\u51b2\u7a81\u5df2\u89e3\u51b3&#xff0c;\u518d\u6267\u884c git commit \u5b8c\u6210\u5408\u5e76\u3002\u5728\u89e3\u51b3\u51b2\u7a81\u524d&#xff0c;\u4e5f\u53ef\u4ee5\u901a\u8fc7 git merge &#8211;abort \u653e\u5f03\u6b64\u6b21\u5408\u5e76&#xff0c;\u6216\u7528 git checkout &#8211;ours\/&#8211;theirs &lt;file&gt; \u4e34\u65f6\u9009\u62e9\u67d0\u4e00\u65b9\u7248\u672c\u3002\u53ca\u65f6\u4e0e\u56e2\u961f\u6210\u5458\u6c9f\u901a&#xff0c;\u907f\u514d\u9891\u7e41\u51b2\u7a81&#xff0c;\u5c3d\u91cf\u5728\u5408\u5e76\u524d\u62c9\u53d6\u6700\u65b0\u4ee3\u7801\u51cf\u5c11\u51b2\u7a81\u53d1\u751f\u51e0\u7387\u3002<\/p>\n<\/li>\n<\/ul>\n<h2>\u4ece Windows \u90e8\u7f72\u4ee3\u7801\u5230 Linux \u670d\u52a1\u5668<\/h2>\n<p>\u5728\u4f01\u4e1a\u73af\u5883\u4e0b&#xff0c;\u5e38\u9700\u5c06\u4ee3\u7801\u4ece\u5f00\u53d1\u673a\u90e8\u7f72\u5230\u8fdc\u7a0b Linux \u670d\u52a1\u5668\u3002\u5e38\u89c1\u65b9\u5f0f\u5305\u62ec\u4f7f\u7528 SSH \u8fdb\u884c\u6587\u4ef6\u4f20\u8f93\u6216\u76f4\u63a5\u5728\u670d\u52a1\u5668\u4e0a\u62c9\u53d6\u4ee3\u7801&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u4f7f\u7528 SCP \u590d\u5236\u6587\u4ef6&#xff1a;scp \u547d\u4ee4\u5229\u7528 SSH \u534f\u8bae\u5b89\u5168\u5730\u590d\u5236\u6587\u4ef6\u3002\u4f8b\u5982\u5728 Git Bash \u6216 PowerShell \u4e2d\u8fd0\u884c&#xff1a;<\/p>\n<p> <span class=\"token function\">scp<\/span> <span class=\"token parameter variable\">-r<\/span> C:<span class=\"token punctuation\">\\\\<\/span>path<span class=\"token punctuation\">\\\\<\/span>to<span class=\"token punctuation\">\\\\<\/span>project user&#064;server.example.com:\/var\/www\/project<\/p>\n<p>\u5176\u4e2d -r \u8868\u793a\u9012\u5f52\u590d\u5236\u6574\u4e2a\u76ee\u5f55\u3002\u8be5\u547d\u4ee4\u4f1a\u8981\u6c42\u8f93\u5165\u670d\u52a1\u5668\u5bc6\u7801&#xff0c;\u6216\u4f7f\u7528\u5df2\u6709\u7684 SSH \u5bc6\u94a5\u514d\u5bc6\u7801\u767b\u5f55\u3002SCP \u9002\u7528\u4e8e\u4e00\u6b21\u6027\u5feb\u901f\u590d\u5236\u6574\u4e2a\u9879\u76ee\u76ee\u5f55\u3002<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528 Rsync \u540c\u6b65\u6587\u4ef6&#xff1a;rsync \u662f\u4e00\u4e2a\u9ad8\u6548\u7684\u8fdc\u7a0b\u540c\u6b65\u5de5\u5177&#xff0c;\u53ea\u4f20\u8f93\u6539\u53d8\u7684\u6587\u4ef6\u90e8\u5206&#xff0c;\u9002\u5408\u9891\u7e41\u66f4\u65b0\u65f6\u4f7f\u7528\u3002\u4f8b\u5982&#xff1a;<\/p>\n<p> <span class=\"token function\">rsync<\/span> <span class=\"token parameter variable\">-avz<\/span> <span class=\"token parameter variable\">-e<\/span> <span class=\"token string\">&#034;ssh -p 22&#034;<\/span> \/c\/path\/to\/project\/ user&#064;server.example.com:\/var\/www\/project\/<\/p>\n<p>\u9009\u9879\u4e2d -a \u8868\u793a\u5f52\u6863\u6a21\u5f0f\u4fdd\u7559\u6743\u9650\u7b49&#xff0c;-v \u663e\u793a\u8be6\u7ec6\u8fc7\u7a0b&#xff0c;-z \u542f\u7528\u538b\u7f29\u4f20\u8f93\u3002-e \u6307\u5b9a\u4f7f\u7528 ssh\u3002rsync \u4ec5\u4f20\u8f93\u4fee\u6539\u8fc7\u7684\u5185\u5bb9&#xff0c;\u6548\u7387\u66f4\u9ad8\u3002\u5728 Windows \u4e0a\u53ef\u4ee5\u901a\u8fc7 Git Bash \u6216 WSL \u5b89\u88c5\u5e76\u4f7f\u7528 rsync\u3002<\/p>\n<\/li>\n<li>\n<p>\u5728\u670d\u52a1\u5668\u4e0a\u76f4\u63a5\u514b\u9686\/\u66f4\u65b0\u4ed3\u5e93&#xff1a;\u5982\u679c\u670d\u52a1\u5668\u53ef\u4ee5\u8bbf\u95ee Git \u4ee3\u7801\u6258\u7ba1\u5e73\u53f0&#xff0c;\u4e5f\u53ef\u4ee5\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c git clone \u6216 git pull\u3002\u4f8b\u5982&#xff1a;<\/p>\n<p> <span class=\"token function\">ssh<\/span> user&#064;server.example.com<br \/>\n<span class=\"token builtin class-name\">cd<\/span> \/var\/www<br \/>\n<span class=\"token function\">git<\/span> clone git&#064;github.com:\u7528\u6237\u540d\/\u4ed3\u5e93\u540d.git<br \/>\n<span class=\"token comment\"># \u4e4b\u540e\u5982\u679c\u9700\u8981\u66f4\u65b0&#xff0c;\u8fdb\u5165\u9879\u76ee\u76ee\u5f55\u8fd0\u884c&#xff1a;<\/span><br \/>\n<span class=\"token function\">git<\/span> pull origin main<\/p>\n<p>\u8fd9\u79cd\u65b9\u5f0f\u9700\u8981\u670d\u52a1\u5668\u5b89\u88c5\u597d Git&#xff0c;\u5e76\u786e\u4fdd\u670d\u52a1\u5668\u7684 SSH \u516c\u94a5\u5df2\u88ab GitHub \u6388\u6743\u3002\u4f18\u70b9\u662f\u53ea\u4f20\u8f93\u4ee3\u7801\u6539\u52a8&#xff0c;\u4e0d\u9700\u8981\u6bcf\u6b21\u624b\u5de5\u590d\u5236\u6574\u4e2a\u9879\u76ee\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u6ce8\u610f\u4e8b\u9879\u4e0e\u63d0\u793a&#xff1a;<\/p>\n<ul>\n<li>\u5728 Windows \u4e0a\u4f7f\u7528 scp \u6216 rsync \u65f6&#xff0c;\u9700\u8981\u5728\u7cfb\u7edf\u4e2d\u5b89\u88c5 OpenSSH&#xff08;Windows 10\/11 \u901a\u5e38\u5df2\u5185\u7f6e&#xff09;&#xff0c;\u6216\u4f7f\u7528 Git Bash \u7b49\u5de5\u5177\u3002<\/li>\n<li>\u4f20\u8f93\u524d\u6700\u597d\u5148\u786e\u8ba4\u670d\u52a1\u5668\u76ee\u6807\u76ee\u5f55\u5b58\u5728\u5e76\u6709\u6b63\u786e\u6743\u9650\u3002<\/li>\n<li>\u5728\u9996\u6b21\u4f7f\u7528 Git \u65b9\u5f0f\u90e8\u7f72\u65f6&#xff0c;\u53ef\u80fd\u9700\u8981\u5148\u914d\u7f6e\u670d\u52a1\u5668\u7aef\u7684 SSH key \u6216\u8fd0\u884c ssh-keygen\u3002<\/li>\n<li>\u65e0\u8bba\u54ea\u79cd\u65b9\u5f0f&#xff0c;\u4fdd\u6301\u6587\u4ef6\u6743\u9650\u548c\u4f9d\u8d56\u5b89\u88c5\u4e00\u81f4\u5f88\u91cd\u8981&#xff0c;\u53ef\u5728\u670d\u52a1\u5668\u4e0a\u7528\u811a\u672c\u5904\u7406\u90e8\u7f72\u540e\u7684\u7f16\u8bd1\u3001\u91cd\u542f\u7b49\u64cd\u4f5c\u3002<\/li>\n<\/ul>\n<p>\u53c2\u8003\u8d44\u6599&#xff1a;Git \u5b98\u65b9\u6587\u6863\u3001Atlassian \u548c GitHub \u6559\u7a0b\u63d0\u4f9b\u4e86\u4e30\u5bcc\u793a\u4f8b\u548c\u8bf4\u660e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb903\u6b21\uff0c\u70b9\u8d5e19\u6b21\uff0c\u6536\u85cf14\u6b21\u3002\u672c\u5730 Git \u914d\u7f6e\u3001\u57fa\u7840\u547d\u4ee4\u3001GitHub \u4e0a\u4f20\u6d41\u7a0b\u3001\u4f01\u4e1a\u5f00\u53d1\u4e2d Git \u7684\u4f7f\u7528\u6d41\u7a0b\u3001\u4ee5\u53ca\u5982\u4f55\u5c06\u4ee3\u7801\u90e8\u7f72\u5230\u751f\u4ea7\u670d\u52a1\u5668\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[89,92,43],"topic":[],"class_list":["post-39142","post","type-post","status-publish","format-standard","hentry","category-server","tag-git","tag-github","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Git \u548c GitHub \u5b66\u4e60\u6307\u5357\u672c\u5730 Git \u914d\u7f6e\u3001\u57fa\u7840\u547d\u4ee4\u3001GitHub \u4e0a\u4f20\u6d41\u7a0b\u3001\u4f01\u4e1a\u5f00\u53d1\u4e2d Git \u7684\u4f7f\u7528\u6d41\u7a0b\u3001\u4ee5\u53ca\u5982\u4f55\u5c06\u4ee3\u7801\u90e8\u7f72\u5230\u751f\u4ea7\u670d\u52a1\u5668 - \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\/39142.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git \u548c GitHub \u5b66\u4e60\u6307\u5357\u672c\u5730 Git \u914d\u7f6e\u3001\u57fa\u7840\u547d\u4ee4\u3001GitHub \u4e0a\u4f20\u6d41\u7a0b\u3001\u4f01\u4e1a\u5f00\u53d1\u4e2d Git \u7684\u4f7f\u7528\u6d41\u7a0b\u3001\u4ee5\u53ca\u5982\u4f55\u5c06\u4ee3\u7801\u90e8\u7f72\u5230\u751f\u4ea7\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb903\u6b21\uff0c\u70b9\u8d5e19\u6b21\uff0c\u6536\u85cf14\u6b21\u3002\u672c\u5730 Git \u914d\u7f6e\u3001\u57fa\u7840\u547d\u4ee4\u3001GitHub \u4e0a\u4f20\u6d41\u7a0b\u3001\u4f01\u4e1a\u5f00\u53d1\u4e2d Git \u7684\u4f7f\u7528\u6d41\u7a0b\u3001\u4ee5\u53ca\u5982\u4f55\u5c06\u4ee3\u7801\u90e8\u7f72\u5230\u751f\u4ea7\u670d\u52a1\u5668\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/39142.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-22T00:21:15+00:00\" \/>\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\/39142.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/39142.html\",\"name\":\"Git \u548c GitHub \u5b66\u4e60\u6307\u5357\u672c\u5730 Git \u914d\u7f6e\u3001\u57fa\u7840\u547d\u4ee4\u3001GitHub \u4e0a\u4f20\u6d41\u7a0b\u3001\u4f01\u4e1a\u5f00\u53d1\u4e2d Git \u7684\u4f7f\u7528\u6d41\u7a0b\u3001\u4ee5\u53ca\u5982\u4f55\u5c06\u4ee3\u7801\u90e8\u7f72\u5230\u751f\u4ea7\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-22T00:21:15+00:00\",\"dateModified\":\"2025-05-22T00:21:15+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/39142.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/39142.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/39142.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Git \u548c GitHub \u5b66\u4e60\u6307\u5357\u672c\u5730 Git \u914d\u7f6e\u3001\u57fa\u7840\u547d\u4ee4\u3001GitHub \u4e0a\u4f20\u6d41\u7a0b\u3001\u4f01\u4e1a\u5f00\u53d1\u4e2d Git \u7684\u4f7f\u7528\u6d41\u7a0b\u3001\u4ee5\u53ca\u5982\u4f55\u5c06\u4ee3\u7801\u90e8\u7f72\u5230\u751f\u4ea7\u670d\u52a1\u5668\"}]},{\"@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":"Git \u548c GitHub \u5b66\u4e60\u6307\u5357\u672c\u5730 Git \u914d\u7f6e\u3001\u57fa\u7840\u547d\u4ee4\u3001GitHub \u4e0a\u4f20\u6d41\u7a0b\u3001\u4f01\u4e1a\u5f00\u53d1\u4e2d Git \u7684\u4f7f\u7528\u6d41\u7a0b\u3001\u4ee5\u53ca\u5982\u4f55\u5c06\u4ee3\u7801\u90e8\u7f72\u5230\u751f\u4ea7\u670d\u52a1\u5668 - \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\/39142.html","og_locale":"zh_CN","og_type":"article","og_title":"Git \u548c GitHub \u5b66\u4e60\u6307\u5357\u672c\u5730 Git \u914d\u7f6e\u3001\u57fa\u7840\u547d\u4ee4\u3001GitHub \u4e0a\u4f20\u6d41\u7a0b\u3001\u4f01\u4e1a\u5f00\u53d1\u4e2d Git \u7684\u4f7f\u7528\u6d41\u7a0b\u3001\u4ee5\u53ca\u5982\u4f55\u5c06\u4ee3\u7801\u90e8\u7f72\u5230\u751f\u4ea7\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb903\u6b21\uff0c\u70b9\u8d5e19\u6b21\uff0c\u6536\u85cf14\u6b21\u3002\u672c\u5730 Git \u914d\u7f6e\u3001\u57fa\u7840\u547d\u4ee4\u3001GitHub \u4e0a\u4f20\u6d41\u7a0b\u3001\u4f01\u4e1a\u5f00\u53d1\u4e2d Git \u7684\u4f7f\u7528\u6d41\u7a0b\u3001\u4ee5\u53ca\u5982\u4f55\u5c06\u4ee3\u7801\u90e8\u7f72\u5230\u751f\u4ea7\u670d\u52a1\u5668\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/39142.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-22T00:21:15+00:00","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\/39142.html","url":"https:\/\/www.wsisp.com\/helps\/39142.html","name":"Git \u548c GitHub \u5b66\u4e60\u6307\u5357\u672c\u5730 Git \u914d\u7f6e\u3001\u57fa\u7840\u547d\u4ee4\u3001GitHub \u4e0a\u4f20\u6d41\u7a0b\u3001\u4f01\u4e1a\u5f00\u53d1\u4e2d Git \u7684\u4f7f\u7528\u6d41\u7a0b\u3001\u4ee5\u53ca\u5982\u4f55\u5c06\u4ee3\u7801\u90e8\u7f72\u5230\u751f\u4ea7\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-22T00:21:15+00:00","dateModified":"2025-05-22T00:21:15+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/39142.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/39142.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/39142.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Git \u548c GitHub \u5b66\u4e60\u6307\u5357\u672c\u5730 Git \u914d\u7f6e\u3001\u57fa\u7840\u547d\u4ee4\u3001GitHub \u4e0a\u4f20\u6d41\u7a0b\u3001\u4f01\u4e1a\u5f00\u53d1\u4e2d Git \u7684\u4f7f\u7528\u6d41\u7a0b\u3001\u4ee5\u53ca\u5982\u4f55\u5c06\u4ee3\u7801\u90e8\u7f72\u5230\u751f\u4ea7\u670d\u52a1\u5668"}]},{"@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\/39142","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=39142"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/39142\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=39142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=39142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=39142"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=39142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}