{"id":1217,"date":"2025-12-22T15:46:37","date_gmt":"2025-12-22T07:46:37","guid":{"rendered":"https:\/\/wp.inskychen.com\/?p=1217"},"modified":"2025-12-22T15:46:37","modified_gmt":"2025-12-22T07:46:37","slug":"git-%e9%96%8b%e7%99%bc%e6%8c%87%e4%bb%a4%e9%80%9f%e6%9f%a5%e6%89%8b%e5%86%8a","status":"publish","type":"post","link":"https:\/\/wp.inskychen.com\/?p=1217","title":{"rendered":"Git \u958b\u767c\u6307\u4ee4\u901f\u67e5\u624b\u518a"},"content":{"rendered":"<p><!-- Git Cheat Sheet for WordPress (Inline Styles) --><\/p>\n<div style=\"font-family: sans-serif; max-width: 800px; margin: 0 auto; line-height: 1.6; color: #333;\">\n<p>    <!-- Header --><\/p>\n<div style=\"text-align: center; margin-bottom: 40px;\">\n<h1 style=\"font-size: 2.25rem; font-weight: 800; color: #1f2937; margin-bottom: 10px;\">Git \u958b\u767c\u6307\u4ee4\u901f\u67e5\u624b\u518a<\/h1>\n<p style=\"color: #6b7280; margin: 0;\">VS Code \u74b0\u5883\u4e0b\u7684\u591a\u88dd\u7f6e (NAS\/Mac) \u5354\u4f5c\u6a19\u6e96\u4f5c\u696d\u7a0b\u5e8f<\/p>\n<\/p><\/div>\n<p>    <!-- \ud83d\udfe2 Section 1: \u65e5\u5e38 SOP --><\/p>\n<div style=\"background: #fff; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); margin-bottom: 24px; overflow: hidden; border-top: 4px solid #22c55e; padding: 24px;\">\n<h2 style=\"color: #16a34a; margin-bottom: 16px; font-size: 1.5rem; display: flex; align-items: center;\">\n            <span style=\"margin-right: 8px;\">\ud83d\udfe2<\/span> \u4e00\u3001\u65e5\u5e38\u958b\u767c\u6a19\u6e96\u6d41\u7a0b (SOP)<br \/>\n        <\/h2>\n<h3 style=\"color: #374151; border-left: 4px solid #22c55e; padding-left: 12px; margin-top: 24px; margin-bottom: 8px; font-size: 1.125rem; font-weight: bold;\">1. \u958b\u5de5\u524d\u7684\u6e96\u5099 (\u5728\u958b\u59cb\u5beb code \u4e4b\u524d)<\/h3>\n<p style=\"margin-bottom: 8px; color: #4b5563;\">\u7121\u8ad6\u5728 A \u96fb\u8166\u9084\u662f B \u96fb\u8166\uff0c\u958b\u5de5\u524d<strong>\u52d9\u5fc5<\/strong>\u57f7\u884c\uff0c\u78ba\u4fdd\u57fa\u790e\u662f\u6700\u65b0\u7684\u3002<\/p>\n<pre style=\"background: #f3f4f6; padding: 16px; border-radius: 8px; overflow-x: auto; margin-bottom: 16px; font-family: monospace; font-size: 0.9em; color: #333;\"><code># 1. \u78ba\u8a8d\u81ea\u5df1\u5728\u54ea\u500b\u5206\u652f (\u770b\u5230 * main \u624d\u662f\u6b63\u78ba)\ngit branch\n\n# 2. \u56de\u5230\u4e3b\u7dda\ngit checkout main\n\n# 3. \u4e0b\u8f09\u6700\u65b0\u9032\u5ea6\ngit pull\n\n# 4. (\u9078\u7528) \u66f4\u65b0\u96f2\u7aef\u5206\u652f\u6e05\u55ae (\u522a\u9664\u672c\u5730\u6b98\u5f71)\ngit fetch -p<\/code><\/pre>\n<h3 style=\"color: #374151; border-left: 4px solid #22c55e; padding-left: 12px; margin-top: 24px; margin-bottom: 8px; font-size: 1.125rem; font-weight: bold;\">2. \u958b\u767c\u65b0\u529f\u80fd (\u8d77\u624b\u5f0f)<\/h3>\n<p style=\"margin-bottom: 8px; color: #4b5563;\"><strong>\u7d55\u5c0d\u4e0d\u8981<\/strong>\u76f4\u63a5\u5728 <code style=\"background: #e5e7eb; padding: 2px 4px; border-radius: 4px; font-family: monospace;\">main<\/code> \u4e0a\u4fee\u6539\u7a0b\u5f0f\u78bc\uff0c\u8acb\u958b\u65b0\u5206\u652f\u3002<\/p>\n<pre style=\"background: #f3f4f6; padding: 16px; border-radius: 8px; overflow-x: auto; margin-bottom: 16px; font-family: monospace; font-size: 0.9em; color: #333;\"><code># \u5efa\u7acb\u4e26\u5207\u63db\u5230\u65b0\u5206\u652f\ngit checkout -b \u5206\u652f\u540d\u7a31\n# \u7bc4\u4f8b: git checkout -b feature-fuel-calc<\/code><\/pre>\n<h3 style=\"color: #374151; border-left: 4px solid #22c55e; padding-left: 12px; margin-top: 24px; margin-bottom: 8px; font-size: 1.125rem; font-weight: bold;\">3. \u5b58\u6a94\u8207\u4e0a\u50b3<\/h3>\n<p style=\"margin-bottom: 8px; color: #4b5563;\">\u505a\u5b8c\u4e00\u500b\u5c0f\u6bb5\u843d\u5c31\u53ef\u4ee5\u5b58\u6a94 (Commit)\u3002\u60a8\u53ef\u4ee5<strong>\u591a\u6b21 Commit<\/strong>\uff0c\u7b49\u5230\u4e00\u500b\u5927\u968e\u6bb5\u5b8c\u6210\u5f8c\u518d\u4e00\u6b21 Push\u3002<\/p>\n<pre style=\"background: #f3f4f6; padding: 16px; border-radius: 8px; overflow-x: auto; margin-bottom: 16px; font-family: monospace; font-size: 0.9em; color: #333;\"><code># 1. \u52a0\u5165\u6240\u6709\u4fee\u6539\ngit add .\n\n# 2. \u63d0\u4ea4\u7248\u672c (\u9019\u662f\u5b58\u5728\u672c\u6a5f\uff0c\u53ef\u4ee5\u505a\u5f88\u591a\u6b21)\ngit commit -m \"\u5b8c\u6210\u5e73\u5747\u6cb9\u8017\u8a08\u7b97\u516c\u5f0f\"\n\n# --- \u60a8\u53ef\u4ee5\u91cd\u8907\u4e0a\u8ff0\u6b65\u9a5f 1 & 2 \u591a\u6b21\uff0c\u7d2f\u7a4d\u591a\u500b\u7248\u672c ---\n\n# 3. \u4e0a\u50b3\u5230\u96f2\u7aef (\u4e00\u6b21\u628a\u6240\u6709\u7d2f\u7a4d\u7684 commit \u63a8\u4e0a\u53bb)\n# (\u7b2c\u4e00\u6b21\u4e0a\u50b3\u8a72\u5206\u652f\u9700\u52a0 -u\uff0c\u4e4b\u5f8c\u76f4\u63a5 git push \u5373\u53ef)\ngit push -u origin \u5206\u652f\u540d\u7a31<\/code><\/pre>\n<div style=\"background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; padding: 12px; border-radius: 6px; font-size: 0.9rem; margin-top: 8px;\">\n            <strong>\ud83d\udca1 \u5c0f\u6280\u5de7\uff1a<\/strong> \u5728\u672c\u6a5f\u53ef\u4ee5\u76e1\u91cf\u983b\u7e41 Commit (\u5b58\u6a94)\uff0c\u9019\u6a23\u53ef\u4ee5\u96a8\u6642\u53cd\u6094\u56de\u5230\u4e0a\u4e00\u6b65\u3002\u4e0d\u7528\u64d4\u5fc3 Commit \u592a\u591a\uff0cGit Push \u6703\u4e00\u6b21\u628a\u6240\u6709\u7d2f\u7a4d\u7684\u9032\u5ea6\u50b3\u4e0a\u53bb\u3002\n        <\/div>\n<h3 style=\"color: #374151; border-left: 4px solid #22c55e; padding-left: 12px; margin-top: 24px; margin-bottom: 8px; font-size: 1.125rem; font-weight: bold;\">4. \u5408\u4f75\u56de\u4e3b\u7dda (\u529f\u80fd\u5b8c\u6210\u5f8c)<\/h3>\n<p style=\"margin-bottom: 8px; color: #4b5563;\">\u7576 <code style=\"background: #e5e7eb; padding: 2px 4px; border-radius: 4px; font-family: monospace;\">feature-xxx<\/code> \u5206\u652f\u7684\u529f\u80fd\u5beb\u597d\u4e14\u6e2c\u8a66\u6c92\u554f\u984c\u4e86\u3002<\/p>\n<pre style=\"background: #f3f4f6; padding: 16px; border-radius: 8px; overflow-x: auto; margin-bottom: 16px; font-family: monospace; font-size: 0.9em; color: #333;\"><code># 1. \u5207\u56de\u4e3b\u7dda\ngit checkout main\n\n# 2. \u518d\u6b21\u78ba\u4fdd\u4e3b\u7dda\u662f\u6700\u65b0\u7684 (\u4ee5\u9632\u5225\u4eba\u5728\u9019\u671f\u9593\u6709\u66f4\u65b0)\ngit pull\n\n# 3. \u5408\u4f75\u5206\u652f\ngit merge \u5206\u652f\u540d\u7a31\n\n# 4. \u63a8\u9001\u4e3b\u7dda\u5230\u96f2\u7aef\ngit push\n\n# 5. \u522a\u9664\u820a\u5206\u652f (\u6253\u6383\u6230\u5834)\ngit branch -d \u5206\u652f\u540d\u7a31<\/code><\/pre>\n<\/p><\/div>\n<p>    <!-- \ud83d\udd04 Section 2: \u591a\u88dd\u7f6e\u5354\u4f5c --><\/p>\n<div style=\"background: #fff; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); margin-bottom: 24px; overflow: hidden; border-top: 4px solid #3b82f6; padding: 24px;\">\n<h2 style=\"color: #2563eb; margin-bottom: 16px; font-size: 1.5rem; display: flex; align-items: center;\">\n            <span style=\"margin-right: 8px;\">\ud83d\udd04<\/span> \u4e8c\u3001\u591a\u88dd\u7f6e\u5354\u4f5c (A \u96fb\u8166\u505a\u5b8c\uff0c\u63db B \u96fb\u8166)<br \/>\n        <\/h2>\n<div style=\"background: #eff6ff; padding: 16px; border-radius: 8px; margin-bottom: 16px; color: #1e40af; font-size: 0.9rem;\">\n            <strong>\u60c5\u5883\uff1a<\/strong> A \u96fb\u8166\u5df2\u7d93\u628a\u529f\u80fd\u5beb\u597d\u3001\u5408\u4f75\u56de main \u4e26\u63a8\u9001\u5230 GitHub \u4e86\u3002\u73fe\u5728\u6253\u958b B \u96fb\u8166\uff0c\u8981\u628a\u9032\u5ea6\u540c\u6b65\u904e\u4f86\u3002\n        <\/div>\n<h3 style=\"color: #374151; border-left: 4px solid #3b82f6; padding-left: 12px; margin-top: 24px; margin-bottom: 8px; font-size: 1.125rem; font-weight: bold;\">B \u96fb\u8166\u64cd\u4f5c\u6b65\u9a5f\uff1a<\/h3>\n<ol style=\"margin-left: 20px; color: #374151; list-style-type: decimal;\">\n<li style=\"margin-bottom: 16px;\">\n                <strong>\u6aa2\u67e5\u72c0\u614b<\/strong>\uff1a\u78ba\u8a8d\u76ee\u524d\u6c92\u6709\u672a\u5b58\u6a94\u7684\u4fee\u6539\u3002\n            <\/li>\n<li style=\"margin-bottom: 16px;\">\n                <strong>\u5207\u56de\u4e3b\u7dda<\/strong>\uff1a<\/p>\n<pre style=\"background: #f3f4f6; padding: 10px; border-radius: 6px; overflow-x: auto; margin-top: 4px; font-family: monospace; font-size: 0.9em; color: #333;\"><code>git checkout main<\/code><\/pre>\n<\/li>\n<li style=\"margin-bottom: 16px;\">\n                <strong>\u540c\u6b65\u8cc7\u6599<\/strong>\uff1a<\/p>\n<pre style=\"background: #f3f4f6; padding: 10px; border-radius: 6px; overflow-x: auto; margin-top: 4px; font-family: monospace; font-size: 0.9em; color: #333;\"><code>git pull<\/code><\/pre>\n<p>                <span style=\"font-size: 0.8em; color: #6b7280; margin-left: 8px;\">(\u73fe\u5728 B \u96fb\u8166\u7684 code \u5c31\u8ddf A \u96fb\u8166\u4e00\u6a23\u4e86)<\/span>\n            <\/li>\n<li style=\"margin-bottom: 16px;\">\n                <strong>\u6e05\u7406\u820a\u5206\u652f<\/strong>\uff1a\u5982\u679c A \u96fb\u8166\u5df2\u7d93\u522a\u9664\u4e86\u67d0\u500b\u5206\u652f\uff0cB \u96fb\u8166\u53ef\u4ee5\u7528\u6b64\u6307\u4ee4\u540c\u6b65\u6e05\u55ae\uff1a<\/p>\n<pre style=\"background: #f3f4f6; padding: 10px; border-radius: 6px; overflow-x: auto; margin-top: 4px; font-family: monospace; font-size: 0.9em; color: #333;\"><code>git fetch -p<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>        <!-- Q&A Box --><\/p>\n<div style=\"margin-top: 32px; background: #eff6ff; border: 1px solid #dbeafe; border-radius: 8px; padding: 20px;\">\n<h3 style=\"margin-top: 0; color: #1e40af; font-size: 1.1rem; border: none; padding: 0;\">Q: A \u96fb\u8166\u63a8\u4e86\u65b0\u5206\u652f\uff0cB \u96fb\u8166 Pull \u6703\u767c\u751f\u4ec0\u9ebc\u4e8b\uff1f<\/h3>\n<p style=\"font-size: 0.9rem; color: #1e3a8a; margin-bottom: 12px;\">\u9019\u662f\u4e00\u500b\u5e38\u898b\u7684\u8aa4\u5340\uff01B \u96fb\u8166\u57f7\u884c <code style=\"background: #dbeafe; padding: 2px 4px; border-radius: 4px;\">git pull<\/code> \u5f8c\uff1a<\/p>\n<ul style=\"list-style-type: disc; margin-left: 20px; font-size: 0.9rem; color: #1e40af; margin-bottom: 12px;\">\n<li>B \u96fb\u8166\u6703<strong>\u77e5\u9053<\/strong>\u6709\u65b0\u5206\u652f (Fetch \u6210\u529f)\u3002<\/li>\n<li>\u4f46 B \u96fb\u8166<strong>\u4e0d\u6703\u81ea\u52d5\u5207\u63db<\/strong>\u904e\u53bb\uff0c\u756b\u9762\u770b\u8d77\u4f86\u6c92\u8b8a\u5316 (\u9084\u662f\u5728 main)\u3002<\/li>\n<\/ul>\n<p style=\"font-size: 0.9rem; color: #1e3a8a; font-weight: bold;\">B \u96fb\u8166\u82e5\u8981\u770b\u5230\u8a72\u5206\u652f\uff0c\u5fc5\u9808\u624b\u52d5\u5207\u63db\uff1a<\/p>\n<pre style=\"background: #fff; border: 1px solid #bfdbfe; padding: 10px; border-radius: 6px; font-family: monospace; font-size: 0.9em; color: #333; margin-top: 8px;\"><code>git checkout \u65b0\u5206\u652f\u540d\u7a31<\/code><\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<p>    <!-- \ud83d\udd34 Section 3: \u6551\u547d\u5c08\u5340 --><\/p>\n<div style=\"background: #fff; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); margin-bottom: 24px; overflow: hidden; border-top: 4px solid #ef4444; padding: 24px;\">\n<h2 style=\"color: #dc2626; margin-bottom: 16px; font-size: 1.5rem; display: flex; align-items: center;\">\n            <span style=\"margin-right: 8px;\">\ud83d\udd34<\/span> \u4e09\u3001\u6551\u547d\u5c08\u5340 (\u932f\u8aa4\u6392\u9664)<br \/>\n        <\/h2>\n<h3 style=\"color: #374151; border-left: 4px solid #ef4444; padding-left: 12px; margin-top: 24px; margin-bottom: 8px; font-size: 1.125rem; font-weight: bold;\">\u72c0\u6cc1 A\uff1aPull \u6216 Checkout \u6642\u88ab\u62d2\u7d55<\/h3>\n<div style=\"background: #fef2f2; padding: 12px; border-radius: 6px; color: #b91c1c; font-size: 0.9rem; margin-bottom: 8px; font-family: monospace;\">\n            error: Your local changes &#8230; would be overwritten by merge\n        <\/div>\n<p style=\"margin-bottom: 16px; color: #4b5563;\"><strong>\u539f\u56e0\uff1a<\/strong> \u60a8\u6709\u6a94\u6848 (<code style=\"background: #e5e7eb; padding: 2px 4px; border-radius: 4px; font-family: monospace;\">index.php<\/code> \u6216\u5716\u7247) \u4fee\u6539\u4e86\u4f46\u6c92\u5b58\u6a94\uff0cGit \u4e0d\u6562\u8986\u84cb\u3002<\/p>\n<div style=\"display: flex; gap: 16px; flex-wrap: wrap;\">\n<div style=\"flex: 1; min-width: 280px; background: #f9fafb; padding: 16px; border-radius: 8px; border: 1px solid #e5e7eb;\">\n                <strong style=\"display: block; margin-bottom: 8px; color: #1f2937;\">\u89e3\u6cd5 1\uff1a\u6211\u4e0d\u8981\u9019\u4e9b\u4fee\u6539\u4e86 (\u76f4\u63a5\u8986\u84cb)<\/strong><\/p>\n<ul style=\"list-style-type: disc; margin-left: 20px; font-size: 0.9rem; color: #4b5563;\">\n<li><strong>VS Code \u64cd\u4f5c\uff1a<\/strong>\u5728\u5de6\u5074\u300c\u539f\u59cb\u78bc\u63a7\u5236\u300d\u5c0d\u8a72\u6a94\u6848\u6309\u53f3\u9375 -> <strong>Discard Changes (\u6368\u68c4\u8b8a\u66f4)<\/strong>\u3002<\/li>\n<li><strong>\u6307\u4ee4\u64cd\u4f5c\uff1a<\/strong><code style=\"background: #e5e7eb; padding: 2px 4px; border-radius: 4px;\">git checkout .<\/code> (\u9084\u539f\u6240\u6709\u6a94\u6848)<\/li>\n<\/ul><\/div>\n<div style=\"flex: 1; min-width: 280px; background: #f9fafb; padding: 16px; border-radius: 8px; border: 1px solid #e5e7eb;\">\n                <strong style=\"display: block; margin-bottom: 8px; color: #1f2937;\">\u89e3\u6cd5 2\uff1a\u6211\u60f3\u4fdd\u7559\u4fee\u6539 (\u66ab\u5b58\u6cd5)<\/strong><\/p>\n<pre style=\"background: #f3f4f6; padding: 8px; border-radius: 6px; overflow-x: auto; font-family: monospace; font-size: 0.85em; color: #333; margin: 0;\"><code>git stash       # \u66ab\u5b58\ngit pull        # \u66f4\u65b0\ngit stash pop   # \u53d6\u56de\u66ab\u5b58<\/code><\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<h3 style=\"color: #374151; border-left: 4px solid #ef4444; padding-left: 12px; margin-top: 24px; margin-bottom: 8px; font-size: 1.125rem; font-weight: bold;\">\u72c0\u6cc1 B\uff1a\u4e0d\u5c0f\u5fc3\u9032\u5165 Detached HEAD<\/h3>\n<div style=\"background: #fef2f2; padding: 12px; border-radius: 6px; color: #b91c1c; font-size: 0.9rem; margin-bottom: 8px; font-family: monospace;\">\n            You are in &#8216;detached HEAD&#8217; state\n        <\/div>\n<p style=\"margin-bottom: 8px; color: #4b5563;\"><strong>\u539f\u56e0\uff1a<\/strong> \u60a8\u4f7f\u7528\u4e86 <code style=\"background: #e5e7eb; padding: 2px 4px; border-radius: 4px; font-family: monospace;\">git checkout origin\/main<\/code> (\u932f\u8aa4\u6307\u4ee4)\uff0c\u8dd1\u5230\u4e86\u552f\u8b80\u7684\u96f2\u7aef\u6620\u50cf\u3002<\/p>\n<pre style=\"background: #f3f4f6; padding: 16px; border-radius: 8px; overflow-x: auto; margin-bottom: 16px; font-family: monospace; font-size: 0.9em; color: #333;\"><code># \u89e3\u6cd5\uff1a\u56de\u5230\u5730\u7403\u8868\u9762\ngit checkout main<\/code><\/pre>\n<h3 style=\"color: #374151; border-left: 4px solid #ef4444; padding-left: 12px; margin-top: 24px; margin-bottom: 8px; font-size: 1.125rem; font-weight: bold;\">\u72c0\u6cc1 C\uff1a\u672c\u5730\u7aef\u5168\u4e82\u4e86\uff0c\u60f3\u5f37\u5236\u8ddf\u96f2\u7aef\u4e00\u6a23<\/h3>\n<div style=\"background: #fefce8; padding: 12px; border-radius: 6px; color: #854d0e; font-size: 0.9rem; margin-bottom: 8px;\">\n            <strong>\u26a0\ufe0f \u8b66\u544a\uff1a<\/strong> \u9019\u6703\u522a\u9664\u6240\u6709\u672a\u4e0a\u50b3\u7684\u4fee\u6539\uff0c\u8acb\u8b39\u614e\u4f7f\u7528\u3002\n        <\/div>\n<p style=\"margin-bottom: 8px; color: #4b5563;\"><strong>\u60c5\u5883\uff1a<\/strong> \u653e\u68c4\u6cbb\u7642\uff0c\u6211\u8981\u8b93\u96fb\u8166\u88e1\u7684\u7a0b\u5f0f\u78bc\u8ddf GitHub \u4e0a <strong>\u4e00\u6a21\u4e00\u6a23<\/strong>\u3002<\/p>\n<pre style=\"background: #f3f4f6; padding: 16px; border-radius: 8px; overflow-x: auto; margin-bottom: 16px; font-family: monospace; font-size: 0.9em; color: #333;\"><code>git fetch --all\ngit reset --hard origin\/main<\/code><\/pre>\n<\/p><\/div>\n<p>    <!-- \u2699\ufe0f Section 4: \u74b0\u5883\u8a2d\u5b9a --><\/p>\n<div style=\"background: #fff; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); margin-bottom: 24px; overflow: hidden; border-top: 4px solid #6b7280; padding: 24px;\">\n<h2 style=\"color: #374151; margin-bottom: 16px; font-size: 1.5rem; display: flex; align-items: center;\">\n            <span style=\"margin-right: 8px;\">\u2699\ufe0f<\/span> \u56db\u3001\u74b0\u5883\u8a2d\u5b9a (Mac \/ Docker)<br \/>\n        <\/h2>\n<div style=\"display: flex; gap: 24px; flex-wrap: wrap;\">\n<div style=\"flex: 1; min-width: 300px;\">\n<h3 style=\"color: #374151; border-left: 4px solid #9ca3af; padding-left: 12px; margin-top: 12px; margin-bottom: 8px; font-size: 1.125rem; font-weight: bold;\">1. Git \u8eab\u5206\u8a2d\u5b9a (\u65b0\u96fb\u8166\u5fc5\u505a)<\/h3>\n<pre style=\"background: #f3f4f6; padding: 16px; border-radius: 8px; overflow-x: auto; font-family: monospace; font-size: 0.9em; color: #333;\"><code>git config --global user.name \"\u60a8\u7684\u540d\u5b57\"\ngit config --global user.email \"\u60a8\u7684GitHub\u4fe1\u7bb1\"<\/code><\/pre>\n<\/p><\/div>\n<div style=\"flex: 1; min-width: 300px;\">\n<h3 style=\"color: #374151; border-left: 4px solid #9ca3af; padding-left: 12px; margin-top: 12px; margin-bottom: 8px; font-size: 1.125rem; font-weight: bold;\">2. Mac \u8a18\u4f4f\u5bc6\u78bc\u8a2d\u5b9a<\/h3>\n<pre style=\"background: #f3f4f6; padding: 16px; border-radius: 8px; overflow-x: auto; font-family: monospace; font-size: 0.9em; color: #333;\"><code>git config --global credential.helper osxkeychain<\/code><\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<h3 style=\"color: #374151; border-left: 4px solid #9ca3af; padding-left: 12px; margin-top: 24px; margin-bottom: 8px; font-size: 1.125rem; font-weight: bold;\">3. Docker \u5e38\u7528\u6307\u4ee4 (\u6e2c\u8a66\u74b0\u5883)<\/h3>\n<p style=\"margin-bottom: 8px; color: #4b5563;\">\u5728\u542b\u6709 <code style=\"background: #e5e7eb; padding: 2px 4px; border-radius: 4px; font-family: monospace;\">docker-compose.yml<\/code> \u7684\u8cc7\u6599\u593e\u4e0b\u57f7\u884c\uff1a<\/p>\n<pre style=\"background: #f3f4f6; padding: 16px; border-radius: 8px; overflow-x: auto; margin-bottom: 16px; font-family: monospace; font-size: 0.9em; color: #333;\"><code># \u555f\u52d5\u74b0\u5883 (\u80cc\u666f\u57f7\u884c)\ndocker-compose up -d\n\n# \u505c\u6b62\u4e26\u79fb\u9664\u74b0\u5883\ndocker-compose down\n\n# \u4fee\u6539\u4e86\u8a2d\u5b9a\u6a94 (\u5982\u52a0\u5165 pdo_mysql) \u5f8c\u5f37\u5236\u91cd\u5efa\ndocker-compose up -d --build<\/code><\/pre>\n<\/p><\/div>\n<p>    <!-- \ud83d\udcdd Section 5: VS Code \u5c0d\u7167\u8868 --><\/p>\n<div style=\"background: #fff; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); margin-bottom: 24px; overflow: hidden; border-top: 4px solid #6366f1; padding: 24px;\">\n<h2 style=\"color: #4f46e5; margin-bottom: 16px; font-size: 1.5rem; display: flex; align-items: center;\">\n            <span style=\"margin-right: 8px;\">\ud83d\udcdd<\/span> \u4e94\u3001VS Code \u5716\u5f62\u4ecb\u9762 vs \u6307\u4ee4\u5c0d\u7167\u8868<br \/>\n        <\/h2>\n<div style=\"overflow-x: auto;\">\n<table style=\"width: 100%; border-collapse: collapse; border: 1px solid #e5e7eb; border-radius: 8px;\">\n<thead>\n<tr style=\"background: #f9fafb;\">\n<th style=\"padding: 12px 24px; text-align: left; font-size: 0.75rem; font-weight: bold; text-transform: uppercase; color: #6b7280; border-bottom: 1px solid #e5e7eb;\">\u52d5\u4f5c<\/th>\n<th style=\"padding: 12px 24px; text-align: left; font-size: 0.75rem; font-weight: bold; text-transform: uppercase; color: #6b7280; border-bottom: 1px solid #e5e7eb;\">\u7d42\u7aef\u6a5f\u6307\u4ee4 (CLI)<\/th>\n<th style=\"padding: 12px 24px; text-align: left; font-size: 0.75rem; font-weight: bold; text-transform: uppercase; color: #6b7280; border-bottom: 1px solid #e5e7eb;\">VS Code \u4ecb\u9762\u64cd\u4f5c<\/th>\n<\/tr>\n<\/thead>\n<tbody style=\"font-size: 0.875rem;\">\n<tr style=\"border-bottom: 1px solid #e5e7eb;\">\n<td style=\"padding: 16px 24px; font-weight: 500; color: #111827;\">\u5207\u63db\u5206\u652f<\/td>\n<td style=\"padding: 16px 24px; font-family: monospace; color: #4f46e5;\">git checkout main<\/td>\n<td style=\"padding: 16px 24px; color: #4b5563;\">\u9ede\u64ca\u5de6\u4e0b\u89d2\u5206\u652f\u540d\u7a31 -> \u9078\u64c7\u6e05\u55ae<\/td>\n<\/tr>\n<tr style=\"border-bottom: 1px solid #e5e7eb;\">\n<td style=\"padding: 16px 24px; font-weight: 500; color: #111827;\">\u5efa\u7acb\u5206\u652f<\/td>\n<td style=\"padding: 16px 24px; font-family: monospace; color: #4f46e5;\">git checkout -b new-branch<\/td>\n<td style=\"padding: 16px 24px; color: #4b5563;\">\u9ede\u64ca\u5de6\u4e0b\u89d2\u5206\u652f\u540d\u7a31 -> Create new branch<\/td>\n<\/tr>\n<tr style=\"border-bottom: 1px solid #e5e7eb;\">\n<td style=\"padding: 16px 24px; font-weight: 500; color: #111827;\">\u540c\u6b65 (Pull\/Push)<\/td>\n<td style=\"padding: 16px 24px; font-family: monospace; color: #4f46e5;\">git pull \/ git push<\/td>\n<td style=\"padding: 16px 24px; color: #4b5563;\">\u9ede\u64ca\u5de6\u4e0b\u89d2\u300c\ud83d\udd04\u300d\u6216\u662f\u300c\u2601\ufe0f\u300d\u5716\u793a<\/td>\n<\/tr>\n<tr style=\"border-bottom: 1px solid #e5e7eb;\">\n<td style=\"padding: 16px 24px; font-weight: 500; color: #111827;\">\u63d0\u4ea4 (Commit)<\/td>\n<td style=\"padding: 16px 24px; font-family: monospace; color: #4f46e5;\">git commit -m &#8220;msg&#8221;<\/td>\n<td style=\"padding: 16px 24px; color: #4b5563;\">\u5de6\u5074\u300c\u539f\u59cb\u78bc\u63a7\u5236\u300d -> \u8f38\u5165\u8a0a\u606f -> Commit<\/td>\n<\/tr>\n<tr style=\"border-bottom: 1px solid #e5e7eb;\">\n<td style=\"padding: 16px 24px; font-weight: 500; color: #111827;\">\u653e\u68c4\u4fee\u6539<\/td>\n<td style=\"padding: 16px 24px; font-family: monospace; color: #4f46e5;\">git checkout .<\/td>\n<td style=\"padding: 16px 24px; color: #4b5563;\">\u5c0d\u6a94\u6848\u6e05\u55ae\u6309\u53f3\u9375 -> <strong>Discard Changes<\/strong><\/td>\n<\/tr>\n<tr style=\"border-bottom: 1px solid #e5e7eb;\">\n<td style=\"padding: 16px 24px; font-weight: 500; color: #111827;\">\u770b\u7dda\u5716<\/td>\n<td style=\"padding: 16px 24px; font-family: monospace; color: #4f46e5;\">git log &#8211;graph<\/td>\n<td style=\"padding: 16px 24px; color: #4b5563;\">\u9ede\u64ca\u4e0b\u65b9\u72c0\u614b\u5217\u7684 <strong>Git Graph<\/strong> \u6309\u9215<\/td>\n<\/tr>\n<tr style=\"border-bottom: 1px solid #e5e7eb;\">\n<td style=\"padding: 16px 24px; font-weight: 500; color: #111827;\">\u66f4\u65b0\u5206\u652f\u6e05\u55ae<\/td>\n<td style=\"padding: 16px 24px; font-family: monospace; color: #4f46e5;\">git fetch -p<\/td>\n<td style=\"padding: 16px 24px; color: #4b5563;\">(Git Graph \u4ecb\u9762) \u53f3\u4e0a\u89d2\u91cd\u65b0\u6574\u7406\u6309\u9215<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<\/p><\/div>\n<footer style=\"text-align: center; color: #9ca3af; font-size: 0.875rem; margin-top: 32px; padding-bottom: 40px;\">\n        &copy; \u5728\u5929\u6587\u5316\u6709\u9650\u516c\u53f8<br \/>\n    <\/footer>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Git \u958b\u767c\u6307\u4ee4\u901f\u67e5\u624b\u518a VS Code \u74b0\u5883\u4e0b\u7684\u591a\u88dd\u7f6e (NAS\/Mac) \u5354\u4f5c\u6a19\u6e96\u4f5c\u696d\u7a0b\u5e8f \ud83d\udfe2 \u4e00\u3001\u65e5\u5e38\u958b\u767c\u6a19\u6e96\u6d41\u7a0b (SOP) 1. \u958b\u5de5\u524d\u7684\u6e96\u5099 (\u5728\u958b\u59cb\u5beb code \u4e4b\u524d) \u7121\u8ad6\u5728 A \u96fb\u8166\u9084\u662f B \u96fb\u8166\uff0c\u958b\u5de5\u524d\u52d9\u5fc5\u57f7\u884c\uff0c\u78ba\u4fdd\u57fa\u790e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1217","post","type-post","status-publish","format-standard","hentry","category-ieee"],"_links":{"self":[{"href":"https:\/\/wp.inskychen.com\/index.php?rest_route=\/wp\/v2\/posts\/1217","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.inskychen.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.inskychen.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.inskychen.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.inskychen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1217"}],"version-history":[{"count":1,"href":"https:\/\/wp.inskychen.com\/index.php?rest_route=\/wp\/v2\/posts\/1217\/revisions"}],"predecessor-version":[{"id":1218,"href":"https:\/\/wp.inskychen.com\/index.php?rest_route=\/wp\/v2\/posts\/1217\/revisions\/1218"}],"wp:attachment":[{"href":"https:\/\/wp.inskychen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1217"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.inskychen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1217"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.inskychen.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}