{"id":25831,"date":"2025-04-03T00:49:39","date_gmt":"2025-04-03T03:49:39","guid":{"rendered":"https:\/\/mastertrend.info\/?p=25831"},"modified":"2025-04-03T00:52:28","modified_gmt":"2025-04-03T03:52:28","slug":"10-%e4%b8%aa%e5%9f%ba%e6%9c%ac-git-%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"https:\/\/mastertrend.info\/zh\/10-comandos-basicos-de-git\/","title":{"rendered":"\u5f00\u53d1\u8005\u5fc5\u5907\u7684 10 \u4e2a\u57fa\u672c Git \u547d\u4ee4\ud83d\udda5\ufe0f"},"content":{"rendered":"<h2>10 \u4e2a\u4fdd\u62a4\u4ee3\u7801\u7684\u57fa\u672c Git \u547d\u4ee4<\/h2>\n<p>\u662f\u5426\u8fd8\u8981\u518d\u71ac\u591c\u5c1d\u8bd5\u6062\u590d\u4e22\u5931\u7684\u4ee3\u7801\u66f4\u6539\uff1f\u4f60\u5e76\u4e0d\u5b64\u5355\u3002\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u6570\u767e\u4e07\u5f00\u53d1\u4eba\u5458\u4fe1\u8d56 Git\uff08\u4e16\u754c\u9886\u5148\u7684\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff09\u6765\u8ffd\u8e2a\u6bcf\u4e00\u4e2a\u53d8\u5316\u5e76\u4fdd\u62a4\u4ed6\u4eec\u7684\u5de5\u4f5c\u3002\u4ee5\u4e0b\u662f\u60a8\u6700\u5e38\u4f7f\u7528\u7684\u547d\u4ee4\u7684\u6458\u8981\u3002 \ud83d\ude80<\/p>\n<p>Si sos nuevo en Git, empecemos con una refrescada. Un repositorio de Git (o <a class=\"wpil_keyword_link\" href=\"https:\/\/mastertrend.info\/zh\/%e4%ba%ba%e5%b7%a5%e6%99%ba%e8%83%bd%e5%92%8c%e8%87%aa%e5%8a%a8%e5%8c%96%e4%bb%a3%e7%90%86\/\" target=\"_blank\"  rel=\"noopener\" title=\"\u4eba\u5de5\u667a\u80fd\u4ee3\u7406\u548c\u81ea\u52a8\u5316\uff1a\u7acb\u5373\u8282\u7701\u65f6\u95f4\u548c\u91d1\u94b1\uff01\u2699\ufe0f\ud83d\ude80\" data-wpil-keyword-link=\"linked\"  data-wpil-monitor-id=\"34551\">\u56de\u8d2d<\/a> en corto) contiene todos los archivos del proyecto y toda la historia de revisiones. Un repo tiene commits, que son los que se usan para registrar los cambios en el repo, y cada commit tiene un breve mensaje que el usuario escribe para indicar qu\u00e9 cambios realiz\u00f3. Git tambi\u00e9n puede <a title=\"Windows 11 \u4e2d\u7981\u7528\u6027\u80fd\u6a21\u5f0f\u6307\u5357\" href=\"https:\/\/mastertrend.info\/zh\/%e7%a6%81%e7%94%a8%e6%80%a7%e8%83%bd%e6%a8%a1%e5%bc%8f\/\" target=\"_blank\" rel=\"noopener\" data-wpil-monitor-id=\"5167\">\u5e2e\u52a9\u7ba1\u7406<\/a> \u5408\u5e76\u4e4b\u524d\u53ef\u80fd\u4f1a\u51fa\u73b0\u51b2\u7a81\uff08\u4f8b\u5982\uff0c\u5982\u679c\u4e24\u4e2a\u4eba\u7f16\u8f91\u540c\u4e00\u884c\u4ee3\u7801\uff09\u3002 <a href=\"https:\/\/git-scm.com\/downloads\/win\" target=\"_blank\" rel=\"noopener\" data-schema-attribute=\"mentions\">\u8981\u4e86\u89e3\u6709\u5173\u5728 Windows \u4e0a\u5b89\u88c5 Git \u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u5355\u51fb\u6b64\u5904\u3002<\/a><\/p>\n<h2 id=\"to-clone-an-existing-repo\"><span class=\"item-num\">1 <\/span> \u514b\u9686\u73b0\u6709\u4ed3\u5e93<\/h2>\n<p>\u6211\u4eec\u53ef\u4ee5\u5f00\u59cb\u7684\u7b2c\u4e00\u4e2a\u547d\u4ee4\u662f <strong>git \u514b\u9686<\/strong>\uff0c\u8fd9\u662f\u4e00\u4e2a\u8fde\u63a5\u548c <a title=\"\u2728 \u5982\u4f55\u5728 Windows 11 \u4e2d\u865a\u5316\u7167\u7247\u80cc\u666f\uff0c\u7ed9\u4f60\u7684\u670b\u53cb\u4eec\u4e00\u4e2a\u60ca\u559c\u3002\" href=\"https:\/\/mastertrend.info\/zh\/%e5%a6%82%e4%bd%95%e5%9c%a8-windows-11-%e4%b8%ad%e6%a8%a1%e7%b3%8a%e7%85%a7%e7%89%87%e8%83%8c%e6%99%af\/\" target=\"_blank\" rel=\"noopener\" data-wpil-monitor-id=\"5168\">\u4e0b\u8f7d\u526f\u672c<\/a> \u4ece\u73b0\u6709\u5b58\u50a8\u5e93\u590d\u5236\u5230\u672c\u5730\u673a\u5668\u3002\u901a\u5e38\uff0c\u73b0\u6709\u7684\u5b58\u50a8\u5e93\u662f\u8fdc\u7a0b\u7684\uff0c\u4f8b\u5982\u5728 GitHub \u6216 GitLab \u4e0a\u3002<\/p>\n<p>\u9996\u5148\uff0c\u8f6c\u5230\u4e00\u4e2a\u5b58\u50a8\u5e93\u5e76\u5355\u51fb\u7eff\u8272\u4e0b\u62c9\u83dc\u5355\u201c\u4ee3\u7801\u201d\uff0c\u7136\u540e\u5355\u51fb GitHub \u5b58\u50a8\u5e93 URL \u65c1\u8fb9\u7684\u590d\u5236\u5230\u526a\u8d34\u677f\u56fe\u6807\uff0c\u5b83\u5c06\u4f7f\u7528 <a title=\"\u8c37\u6b4c\u6d4f\u89c8\u5668\uff1a\u77ac\u95f4\u663e\u793a\u9690\u85cf\u7f51\u5740\u7684\u6280\u5de7\" href=\"https:\/\/mastertrend.info\/zh\/%e6%b3%84%e9%9c%b2%e7%bd%91%e5%9d%80%e7%9a%84%e6%8a%80%e5%b7%a7\/\" target=\"_blank\" rel=\"noopener\" data-wpil-monitor-id=\"5166\">\u7f51\u5740<\/a>\u3002\u8fd9\u662f\u6700\u7b80\u5355\u7684\u65b9\u6cd5\uff0c\u4f7f\u7528 HTTPS \u8fdb\u884c\u514b\u9686\uff1a<\/p>\n<figure>    <img decoding=\"async\" style=\"height: auto;max-width: 100%\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/11\/10-Comandos-Basicos-de-Git-para-Empezar.png\" alt=\"\u7bad\u5934\u6570\u91cf\u663e\u793a\u5728 GitHub \u4e0a\u901a\u8fc7 HTTPS \u514b\u9686\u5b58\u50a8\u5e93\u7684\u9009\u9879\u3002\" width=\"1454\" height=\"812\" title=\"\"> <\/figure>\n<p>\u7136\u540e\uff0c\u4f7f\u7528\u521a\u521a\u590d\u5236\u7684 URL \u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"hljs php\">git <span class=\"hljs-keyword\">\u514b\u9686<\/span> https\uff1a<\/code><\/pre>\n<figure>    <img decoding=\"async\" style=\"height: auto;max-width: 100%\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/11\/1731397110_892_10-Comandos-Basicos-de-Git-para-Empezar.png\" alt=\"Git Bash CLI \u4e2d\u7684 Repo \u514b\u9686\u5b8c\u6210\u6d88\u606f\u3002\" width=\"878\" height=\"519\" title=\"\"> <\/figure>\n<p>\u4e00\u65e6 repo \u88ab\u514b\u9686\uff0c\u4f60\u7684\u673a\u5668\u4e0a\u5c31\u4f1a\u6709\u5b83\u7684\u672c\u5730\u526f\u672c\u3002 \ud83d\udc4d<\/p>\n<section class=\"emaki-custom-block emaki-custom-note\">\u5982\u679c\u51fa\u73b0\u9519\u8bef\u201c\u81f4\u547d\uff1a\u672a\u627e\u5230\u5b58\u50a8\u5e93\u201d\uff0c\u8bf7\u68c0\u67e5 URL\u3002\u5982\u679c\u5b83\u662f\u79c1\u4eba\u5b58\u50a8\u5e93\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u6743\u9650\u624d\u80fd\u8bbf\u95ee\u5b83\u3002<\/section>\n<h2 id=\"to-create-a-new-repo\"><span class=\"item-num\">2 <\/span> \u521b\u5efa\u65b0\u7684 Repo<\/h2>\n<p>\u5982\u679c\u4f60\u60f3\u8981\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 Git \u5b58\u50a8\u5e93\uff0c\u800c\u4e0d\u662f\u514b\u9686\u73b0\u6709\u7684\u5b58\u50a8\u5e93\uff0c\u8bf7\u8fd0\u884c <strong>git init<\/strong>\u3002\u8fd9\u5c06\u901a\u8fc7\u63d0\u4f9b\u8def\u5f84\u6765\u521d\u59cb\u5316\u6307\u5b9a\u76ee\u5f55\u4e2d\u7684\u5b58\u50a8\u5e93\u3002\u56e0\u6b64\uff0c\u5bf9\u4e8e\u60f3\u8981\u5f00\u59cb\u4f7f\u7528 Git \u7684\u65b0\u9879\u76ee\u6216\u672a\u8ddf\u8e2a\u7684\u9879\u76ee\u6765\u8bf4\uff0c\u5b83\u662f\u7406\u60f3\u7684\u9009\u62e9\u3002<\/p>\n<p>\u9996\u5148\uff0c\u5728\u8fd0\u884c\u547d\u4ee4\u4e4b\u524d\u786e\u4fdd\u60a8\u4f4d\u4e8e\u6b63\u786e\u7684\u6587\u4ef6\u5939\u4e2d\uff1a<\/p>\n<pre><code class=\"hljs\">git init<\/code><\/pre>\n<figure>    <img decoding=\"async\" style=\"height: auto;max-width: 100%\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/11\/1731397111_252_10-Comandos-Basicos-de-Git-para-Empezar.png\" alt=\"Git init \u547d\u4ee4\u4e2d\u7684\u7a7a repo \u9519\u8bef\u6d88\u606f\u3002\" width=\"879\" height=\"518\" title=\"\"> <\/figure>\n<h2 id=\"creating-a-branch-for-collaboration\"><span class=\"item-num\">3 <\/span> \u521b\u5efa\u5206\u652f\u4ee5\u8fdb\u884c\u534f\u4f5c<\/h2>\n<p>Git \u4e2d\u7684\u5206\u652f\u662f\u5b58\u50a8\u5e93\u7684\u4e00\u4e2a\u7248\u672c\uff0c\u56e0\u6b64\u591a\u4e2a\u4eba\u53ef\u4ee5\u540c\u65f6\u5904\u7406\u4e00\u4e2a\u5b58\u50a8\u5e93\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u5b83\u662f repo \u5185\u4e00\u6761\u72ec\u7acb\u7684\u5f00\u53d1\u7ebf\u3002\u4e00\u4e2a repo \u4e2d\u901a\u5e38\u6709\u591a\u4e2a\u5206\u652f\u3002<\/p>\n<p>\u8981\u521b\u5efa\u672c\u5730\u5206\u652f\uff0c\u8bf7\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"hljs\">git branch \u5206\u652f\u540d\u79f0<\/code><\/pre>\n<p>\u8981\u5217\u51fa\u6240\u6709\u5206\u652f\uff0c\u8bf7\u8fd0\u884c\uff1a<\/p>\n<pre><code class=\"hljs\">git \u5206\u652f<\/code><\/pre>\n<p>\u8981\u5220\u9664\u5206\u652f\uff1a<\/p>\n<pre><code class=\"hljs\">git branch -d \u5206\u652f\u540d\u79f0<\/code><\/pre>\n<section class=\"emaki-custom-block emaki-custom-tip\">\u5f53\u5220\u9664\u5206\u652f\u65f6\uff0c\u6709\u65f6\u9700\u8981\u5f3a\u5236\u5220\u9664\u3002\u4f60\u53ea\u9700\u8981\u5927\u5199 <strong>-D<\/strong>\uff0c \u6240\u4ee5\uff1a <strong>git branch -D \u5206\u652f\u540d\u79f0<\/strong><\/section>\n<h2 id=\"switch-between-branches\"><span class=\"item-num\">4 <\/span> \u5728\u5206\u652f\u4e4b\u95f4\u5207\u6362<\/h2>\n<p>\u8be5\u547d\u4ee4 <strong>git \u7b7e\u51fa<\/strong> \u5b83\u662f\u6700\u5e38\u7528\u7684\u5de5\u5177\u4e4b\u4e00\uff0c\u4e3b\u8981\u7528\u4e8e\u5728\u5206\u652f\u4e4b\u95f4\u5207\u6362\uff0c\u4f46\u4e5f\u53ef\u4ee5\u7528\u4e8e\u67e5\u770b\u6587\u4ef6\u548c\u63d0\u4ea4\u3002<\/p>\n<p>\u8981\u5728\u5206\u652f\u4e4b\u95f4\u5207\u6362\u5e76\u5728\u672c\u5730\u76ee\u5f55\u4e2d\u7b7e\u51fa\u5b83\u4eec\uff1a<\/p>\n<pre><code class=\"hljs xml\">git checkout \u5206\u652f\u540d\u79f0\r\n<\/code><\/pre>\n<p>\u5bf9\u4e8e\u8f83\u65b0\u7248\u672c\u7684 git\uff0c\u60a8\u53ef\u4ee5\u8fd0\u884c\uff1a<\/p>\n<pre><code class=\"hljs javascript\">git <span class=\"hljs-keyword\">\u8f6c\u53d8<\/span> \u5206\u652f\u540d\u79f0<\/code><\/pre>\n<p>\u4e3a\u4e86\u4f7f\u4e0a\u8ff0\u547d\u4ee4\u8d77\u4f5c\u7528\uff0c\u60a8\u8981\u5207\u6362\u5230\u7684\u5206\u652f\u5fc5\u987b\u5728\u672c\u5730\u5b58\u5728\uff0c\u5e76\u4e14\u5fc5\u987b\u5148\u63d0\u4ea4\u6216\u4fdd\u5b58\u5bf9\u5f53\u524d\u5206\u652f\u7684\u4efb\u4f55\u66f4\u6539\u3002<\/p>\n<section class=\"emaki-custom-block emaki-custom-tip\">\u540c\u65f6\u521b\u5efa\u548c\u5207\u6362\u5206\u652f\u7684\u5feb\u6377\u547d\u4ee4\uff1a <strong>git checkout -b \u5206\u652f\u540d\u79f0<\/strong><\/section>\n<h2 id=\"check-git-status\"><span class=\"item-num\">5 <\/span> \u68c0\u67e5 Git \u72b6\u6001<\/h2>\n<p>\u8fd9\u662f\u53e6\u4e00\u4e2a\u5e38\u7528\u547d\u4ee4\uff0c\u5b83\u53ef\u4ee5\u544a\u8bc9\u60a8\u6709\u5173\u5f53\u524d\u5206\u652f\u7684\u4e0d\u540c\u4fe1\u606f\uff0c\u4f8b\u5982\u5f53\u524d\u5206\u652f\u662f\u5426\u662f\u6700\u65b0\u7684\uff0c\u662f\u5426\u8fd8\u6709\u4efb\u4f55\u5185\u5bb9\u9700\u8981\u63d0\u4ea4\u6216\u63a8\u9001\uff0c\u4ee5\u53ca\u662f\u5426\u6709\u4efb\u4f55\u6587\u4ef6\u88ab\u4fee\u6539\u6216\u5220\u9664\u3002<\/p>\n<pre><code class=\"hljs\">git \u72b6\u6001<\/code><\/pre>\n<p>\u5982\u679c\u6ca1\u6709\u8fdb\u884c\u4efb\u4f55\u66f4\u6539\uff0c\u8f93\u51fa\u5e94\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<figure>    <img decoding=\"async\" style=\"height: auto;max-width: 100%\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/11\/1731397111_826_10-Comandos-Basicos-de-Git-para-Empezar.png\" alt=\"\u547d\u4ee4\u884c\u4e0a\u7684 Git status \u547d\u4ee4\u8f93\u51fa\u7684\u5185\u5bb9\u662f\u201c\u65e0\u9700\u63d0\u4ea4\uff0c\u6e05\u7406\u5de5\u4f5c\u6811\u201d\u3002\" width=\"877\" height=\"516\" title=\"\"> <\/figure>\n<h2 id=\"commit-sets-of-changes\"><span class=\"item-num\">6 <\/span> \u63d0\u4ea4\u53d8\u66f4\u96c6<\/h2>\n<p>\u8fd9\u53ef\u80fd\u662f\u6700\u5e38\u7528\u7684 Git \u547d\u4ee4\u3002\u5f53\u6211\u4eec\u51c6\u5907\u4fdd\u5b58\u5de5\u4f5c\u65f6\uff08\u53ef\u80fd\u662f\u5728\u5b8c\u6210\u7279\u5b9a\u4efb\u52a1\u6216\u9047\u5230\u95ee\u9898\u4e4b\u540e\uff09\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 <strong>git \u63d0\u4ea4<\/strong>\u3002\u8fd9\u5b9e\u9645\u4e0a\u6355\u83b7\u4e86\u9879\u76ee\u4e2d\u5f53\u524d\u6b63\u5728\u51c6\u5907\u7684\u66f4\u6539\u7684\u5feb\u7167\u3002<\/p>\n<p>\u60a8\u8fd8\u9700\u8981\u5199\u4e00\u4e2a\u7b80\u77ed\u800c\u6e05\u6670\u7684\u63d0\u4ea4\u4fe1\u606f\uff0c\u4ee5\u4fbf\u60a8\u548c\u5176\u4ed6\u5f00\u53d1\u4eba\u5458\u4e86\u89e3\u8fd9\u4e9b\u66f4\u6539\u3002\u4e0d\u8981\u5fd8\u8bb0\u7528\u5f15\u53f7\u5c06\u5176\u62ec\u8d77\u6765\u3002<\/p>\n<pre><code class=\"hljs sql\">git <span class=\"hljs-keyword\">\u72af\u7f6a<\/span> -m <span class=\"hljs-string\">\u201c\u786e\u8ba4\u4fe1\u606f\u201d<\/span><\/code><\/pre>\n<section class=\"emaki-custom-block emaki-custom-warning\"><strong>Git \u63d0\u4ea4<\/strong> \u53ea\u9700\u5728\u672c\u5730\u4fdd\u5b58\u60a8\u7684\u66f4\u6539\u5373\u53ef\u3002\u60a8\u4ecd\u7136\u9700\u8981\u5c06\u5b83\u4eec\u201c\u63a8\u9001\u201d\u81f3\u8fdc\u7a0b\u5b58\u50a8\u5e93\u3002<\/section>\n<h2 id=\"rolling-back-changes\"><span class=\"item-num\">7 <\/span> \u64a4\u6d88\u66f4\u6539<\/h2>\n<p>\u8be5\u547d\u4ee4 <strong>git \u6062\u590d<\/strong> \u5141\u8bb8\u4f60 <a title=\"\u5982\u4f55\u4f7f\u7528 CMD \u91cd\u7f6e Windows 10\/11\" href=\"https:\/\/mastertrend.info\/zh\/%e5%a6%82%e4%bd%95%e9%80%9a%e8%bf%87cmd%e9%87%8d%e7%bd%aewindows-10-11\/\" target=\"_blank\" rel=\"noopener\" data-wpil-monitor-id=\"5164\">\u6392\u9664<\/a> \u5355\u6b21\u63d0\u4ea4\u5bf9\u60a8\u7684\u672c\u5730\u4ed3\u5e93\u6240\u505a\u7684\u6240\u6709\u66f4\u6539\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5148\u524d\u7684\u63d0\u4ea4\u5c06\u4e00\u4e2a\u540d\u4e3a ReadMe.md \u7684\u6587\u4ef6\u6dfb\u52a0\u5230\u4ed3\u5e93\uff0c\u5219 <strong>git \u6062\u590d<\/strong> \u5728\u8be5\u63d0\u4ea4\u4e2d\uff0c\u60a8\u5c06\u4ece repo \u4e2d\u5220\u9664 ReadMe.md\u3002\u8fd8\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u63d0\u4ea4\u6765\u53cd\u6620\u8fd9\u4e00\u53d8\u5316\u3002<\/p>\n<p>\u4f60\u9700\u8981\u505a\u7684\u5c31\u662f\u8fd0\u884c <strong>git \u6062\u590d<\/strong> \u540e\u9762\u8ddf\u7740\u63d0\u4ea4 ID\uff1a<\/p>\n<pre><code class=\"hljs sql\">git \u6062\u590d <span class=\"hljs-keyword\">\u72af\u7f6a<\/span>-<span class=\"hljs-keyword\">ID<\/span><\/code><\/pre>\n<p>\u5982\u679c\u4f60\u8fdb\u884c\u4e86\u5f88\u591a\u6b21\u63d0\u4ea4\uff0c\u4f46\u4e0d\u786e\u5b9a\u63d0\u4ea4 ID \u5728\u54ea\u91cc\uff0c\u5219\u53ef\u4ee5\u901a\u8fc7\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u8bc6\u522b\u63d0\u4ea4 <strong>git \u65e5\u5fd7<\/strong>\u3002\u590d\u5236\u63d0\u4ea4 ID \u5e76\u8fd0\u884c\u547d\u4ee4 <strong>git \u65e5\u5fd7<\/strong> \u4f7f\u7528\u63d0\u4ea4 ID\u3002<\/p>\n<figure>    <img decoding=\"async\" style=\"height: auto;max-width: 100%\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2024\/11\/1731397111_213_10-Comandos-Basicos-de-Git-para-Empezar.png\" alt=\"CLI \u4e2d\u7684 Git log \u547d\u4ee4\u663e\u793a\u4ee5\u524d\u7684\u63d0\u4ea4\u548c\u63d0\u4ea4 ID\u3002\" width=\"873\" height=\"703\" title=\"\"> <\/figure>\n<section class=\"emaki-custom-block emaki-custom-warning\">\u4e0d\u8981\u6df7\u6dc6 <strong>git \u6062\u590d<\/strong> \u548c <strong>git \u91cd\u7f6e<\/strong>\u3002\u540e\u8005\u5c06\u64a4\u6d88\u81ea\u7ed9\u5b9a\u63d0\u4ea4\u4ee5\u6765\u53d1\u751f\u7684\u6bcf\u4e2a\u66f4\u6539\u5e76\u66f4\u6539\u63d0\u4ea4\u5386\u53f2\u8bb0\u5f55\u3002\u5982\u679c\u5176\u4ed6\u4eba\u4e5f\u5728\u540c\u4e00\u4e2a\u5206\u652f\u4e0a\u5de5\u4f5c\uff0c\u90a3\u4e48\u8fd9\u5e76\u4e0d\u7406\u60f3\u3002<\/section>\n<h2 id=\"upload-all-your-local-changes\"><span class=\"item-num\">8 <\/span> \u4e0a\u4f20\u6240\u6709\u672c\u5730\u66f4\u6539<\/h2>\n<p>\u5b8c\u6210\u6240\u6709\u66f4\u6539\u5e76\u63d0\u4ea4\u540e\uff0c\u60a8\u5c06\u9700\u8981\u5c06\u672c\u5730\u66f4\u6539\u63a8\u9001\u5230\u8fdc\u7a0b\u5b58\u50a8\u5e93\u3002\u63a8\u9001\u662f\u5c06\u8fd9\u4e9b\u66f4\u6539\u8fde\u540c\u60a8\u7684\u63d0\u4ea4\u4e00\u8d77\u4ece\u672c\u5730\u8ba1\u7b97\u673a\u4f20\u8f93\u5230\u8fdc\u7a0b\u5b58\u50a8\u5e93\u7684\u884c\u4e3a\u3002\u60a8\u53ef\u4ee5\u6307\u5b9a\u8981\u5c06\u66f4\u6539\u53d1\u9001\u5230\u54ea\u4e2a\u5206\u652f\u3002<\/p>\n<pre><code class=\"hljs\">git push origin master<\/code><\/pre>\n<p>\u4e0a\u8ff0\u547d\u4ee4\u5c06\u66f4\u6539\u63a8\u9001\u5230 master \u5206\u652f\uff08master \u901a\u5e38\u88ab\u8ba4\u4e3a\u662f\u4e3b\u5206\u652f\uff0c\u4f46\u201cmain\u201d \u4e5f\u5f88\u5e38\u7528\uff09\u3002\u662f\u7684 <strong>\u638c\u63e1<\/strong> \u4e0d\u8d77\u4f5c\u7528\uff0c\u5c1d\u8bd5 <strong>\u4e3b\u8981\u7684<\/strong>.<\/p>\n<section class=\"emaki-custom-block emaki-custom-tip\">\u5efa\u8bae\u8fd0\u884c <strong>git \u72b6\u6001<\/strong> \u4e0a\u4f20\u60a8\u7684\u66f4\u6539\u4e4b\u524d\u3002<\/section>\n<h2 id=\"retrieve-all-changes\"><span class=\"item-num\">9 <\/span> \u6062\u590d\u6240\u6709\u66f4\u6539<\/h2>\n<p>\u5f53\u6211\u56de\u5230\u9879\u76ee\u5e76\u9700\u8981\u68c0\u7d22\u5bf9\u4e3b\u5206\u652f\u6240\u505a\u7684\u6240\u6709\u65b0\u66f4\u6539\uff08\u901a\u8fc7\u6211\u7684\u5408\u5e76\u6216\u6765\u81ea\u5176\u4ed6\u5f00\u53d1\u4eba\u5458\uff09\u65f6\uff0c\u6211\u4f7f\u7528\u8fd9\u4e2a\u547d\u4ee4\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u5b83\u662f\u5f53\u60a8\u60f3\u8981\u4ece\u8fdc\u7a0b\u5b58\u50a8\u5e93\u83b7\u53d6\u66f4\u65b0\u65f6\u4f7f\u7528\u7684\u547d\u4ee4\u3002<\/p>\n<pre><code class=\"hljs\">git pull \u6e90\u4e3b\u76ee\u5f55<\/code><\/pre>\n<p>\u548c\u4ee5\u524d\u4e00\u6837\uff0c\u662f\u7684 <strong>\u638c\u63e1<\/strong> \u4e0d\u8d77\u4f5c\u7528\uff0c\u5c1d\u8bd5 <strong>\u4e3b\u8981\u7684<\/strong>\u3002\u7531\u4e8e\u6b64\u547d\u4ee4\u7ed3\u5408\u4e86 <strong>git \u83b7\u53d6<\/strong> \u548c <strong>git \u5408\u5e76<\/strong>\uff0c\u7acb\u5373\u5c06\u6700\u65b0\u4fee\u6539\u5e94\u7528\u5230\u60a8\u7684\u672c\u5730\u5b58\u50a8\u5e93\uff08<strong>git \u5408\u5e76<\/strong>) \u4ece\u8fdc\u7a0b\u5b58\u50a8\u5e93\u68c0\u7d22\u66f4\u65b0\u540e (<strong>git \u83b7\u53d6<\/strong>\uff09\u3002\u60a8\u53ef\u4ee5\u4e86\u89e3\u6709\u5173 Git \u4e2d\u7684\u62c9\u53d6\u8bf7\u6c42\u7684\u66f4\u591a\u4fe1\u606f\u3002<\/p>\n<h2 id=\"merge-it-all-together\"><span class=\"item-num\">10 <\/span> \u5c06\u5176\u5408\u5e76\u5728\u4e00\u8d77<\/h2>\n<p>\u6700\u540e\uff0c\u4e00\u65e6\u60a8\u5b8c\u6210\u4e86\u5206\u652f\u4e0a\u7684\u5de5\u4f5c\u5e76\u4e14\u4e00\u5207\u6b63\u5e38\u8fd0\u884c\uff0c\u6700\u540e\u4e00\u6b65\u5c31\u662f\u5c06\u5206\u652f\u5408\u5e76\u5230\u4e3b\u5206\u652f\uff08\u901a\u5e38\u662f dev \u6216 master\uff0c\u4f46\u8bf7\u68c0\u67e5 repo\uff09\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u901a\u8fc7\u8fd0\u884c\u547d\u4ee4\u6765\u6267\u884c\u6b64\u64cd\u4f5c <strong>git \u5408\u5e76<\/strong>\u3002\u9996\u5148\u4f60\u5e94\u8be5 <a title=\"\u5728 Xbox 360 \u4e0a\u8fd0\u884c AI \u6a21\u578b\uff1a\u592a\u68d2\u4e86\ud83d\udc7e\" href=\"https:\/\/mastertrend.info\/zh\/%e5%9c%a8-xbox-360-%e4%b8%8a%e8%bf%90%e8%a1%8c-ai-%e6%a8%a1%e5%9e%8b\/\" target=\"_blank\" rel=\"noopener\" data-wpil-monitor-id=\"5165\">\u6267\u884c <strong>git \u83b7\u53d6<\/strong> \u66f4\u65b0\u4f60\u7684\u5206\u652f<\/a> \u672c\u5730\uff0c\u7136\u540e\u8fdb\u884c\u5408\u5e76\uff1a<\/p>\n<pre><code class=\"hljs sql\">git <span class=\"hljs-keyword\">\u5408\u5e76<\/span> \u5206\u652f\u540d\u79f0<\/code><\/pre>\n<section class=\"emaki-custom-block emaki-custom-note\">\u786e\u4fdd\u60a8\u4f4d\u4e8e\u8981\u5408\u5e76\u5230\u8fdc\u7a0b\u4e3b\u5206\u652f\u7684\u5206\u652f\u4e0a\u3002<\/section>\n<hr \/>\n<p>\u6700\u540e\uff0c\u5b66\u4e60 Git \u5c31\u50cf\u9a91\u81ea\u884c\u8f66\uff1a\u4e00\u65e6\u5f00\u59cb\uff0c\u6bcf\u63a8\u4e00\u4e0b\u5c31\u4f1a\u53d8\u5f97\u66f4\u5bb9\u6613\uff01 \ud83d\udeb4\u200d\u2642\ufe0f\ud83d\udcbb<\/p>","protected":false},"excerpt":{"rendered":"<p>10 \u4e2a\u57fa\u672c Git \u547d\u4ee4\u638c\u63e1\u8fd9\u4e9b\u547d\u4ee4\uff0c\u907f\u514d\u8f7b\u6613\u4e22\u5931\u4ee3\u7801 \ud83d\udca1\ud83d\ude80<\/p>","protected":false},"author":1,"featured_media":25832,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ai_generated_summary":"","iawp_total_views":30,"jnews-multi-image_gallery":[],"jnews_single_post":[],"jnews_primary_category":[],"jnews_social_meta":[],"jnews_review":[],"enable_review":"","type":"","name":"","summary":"","brand":"","sku":"","good":[],"bad":[],"score_override":"","override_value":"","rating":[],"price":[],"jnews_override_counter":[],"footnotes":""},"categories":[1435],"tags":[1445,1558,1581],"class_list":["post-25831","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutoriales","tag-evergreencontent","tag-techtips","tag-windowstips"],"_links":{"self":[{"href":"https:\/\/mastertrend.info\/zh\/wp-json\/wp\/v2\/posts\/25831","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mastertrend.info\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mastertrend.info\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mastertrend.info\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mastertrend.info\/zh\/wp-json\/wp\/v2\/comments?post=25831"}],"version-history":[{"count":15,"href":"https:\/\/mastertrend.info\/zh\/wp-json\/wp\/v2\/posts\/25831\/revisions"}],"predecessor-version":[{"id":105574,"href":"https:\/\/mastertrend.info\/zh\/wp-json\/wp\/v2\/posts\/25831\/revisions\/105574"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mastertrend.info\/zh\/wp-json\/wp\/v2\/media\/25832"}],"wp:attachment":[{"href":"https:\/\/mastertrend.info\/zh\/wp-json\/wp\/v2\/media?parent=25831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mastertrend.info\/zh\/wp-json\/wp\/v2\/categories?post=25831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mastertrend.info\/zh\/wp-json\/wp\/v2\/tags?post=25831"}],"curies":[{"name":"\u53ef\u6e7f\u6027\u7c89\u5242","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}