{"id":37342,"date":"2022-09-01T00:26:19","date_gmt":"2023-09-18T16:31:59","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e8%a6%81%e8%ae%a9%e4%bd%a0%e6%83%b3%e8%b5%b7git\/"},"modified":"2024-01-15T09:25:03","modified_gmt":"2024-01-15T01:25:03","slug":"%e6%88%91%e8%a6%81%e8%ae%a9%e4%bd%a0%e6%83%b3%e8%b5%b7git","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e8%a6%81%e8%ae%a9%e4%bd%a0%e6%83%b3%e8%b5%b7git\/","title":{"rendered":"\u6211\u8981\u8ba9\u4f60\u60f3\u8d77Git"},"content":{"rendered":"<h2>\u9996\u5148<\/h2>\n<p>\u6211\u5fd8\u8bb0\u4e86\u5982\u4f55\u4f7f\u7528Git\u3002\u6240\u4ee5\u8ba9\u6211\u4eec\u4e00\u8d77\u56de\u5fc6\u4e00\u4e0b\u5427~ \u8fd9\u53ea\u662f\u4e00\u4e2a\u5f88\u7b80\u5355\u7684\u6587\u7ae0\uff0c\u8bf7\u60a8\u8c05\u89e3\uff01<\/p>\n<p>\u6211\u4f7f\u7528\u4e86\u65b0\u8cb7\u7684Mac\u4f5c\u696d\u74b0\u5883\uff0c\u771f\u5e25\u3002\u5982\u679c\u80fd\u5728\u9019\u88e1\u5b89\u88ddGit\uff0c\u7136\u5f8c\u96a8\u4fbf\u5275\u5efa\u4e00\u500b\u5009\u5eab\uff0c\u9032\u884c\u514b\u9686\u548c\u63a8\u9001\u7684\u64cd\u4f5c\u6e2c\u8a66\uff0c\u5c31\u9054\u5230\u76ee\u6a19\u4e86\u3002<\/p>\n<p>\u9806\u4fbf\u63d0\u4e00\u4e0b\uff0c\u542c\u8bf42022\u5e7410\u6708\u4f1a\u6709\u642d\u8f7dM2\u82af\u7247\u7684Mac\u9762\u4e16\u3002<br \/>\n\u6211\u5728\u540c\u5e749\u6708\u8d2d\u4e70\u4e862021\u5e74\u6b3e\u7684Mac\u3002<br \/>\n\u91cd\u8981\u7684\u4e8b\u60c5\u5e94\u8be5\u65e9\u70b9\u8bf4\u51fa\u6765\u3002<\/p>\n<h2>2. \u5b89\u88c5Homebrew<\/h2>\n<p>\u5b89\u88c5Homebrew\u4ee5\u4fbf\u5b89\u88c5Git\u3002\u6309\u7167\u5b98\u65b9\u6307\u5357\u8fdb\u884c\u64cd\u4f5c\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u5b89\u88c5\u540e\u51fa\u73b0\u8b66\u544a\uff0c\u67e5\u4e86\u4e00\u4e0b\u8bf4\u5fc5\u987b\u8bbe\u7f6e\u8def\u5f84\u3002\u901a\u8fc7\u8c37\u6b4c\u641c\u7d22\u6309\u7167\u8fd9\u7bc7\u6587\u7ae0\u7684\u6b65\u9aa4\u64cd\u4f5c\u89e3\u51b3\u4e86\u95ee\u9898\u3002\u975e\u5e38\u611f\u8c22\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>3. \u5b89\u88c5Git<\/h2>\n<p>\u6df1\u601d\u719f\u8651\u5730\u6267\u884c\uff0c\u800c\u4e0d\u8003\u8651\u592a\u591a\u3002<br \/>\nsoshi.sato\u662f\u6211\u7684\u7528\u6237\u540d\uff08\u771f\u5b9e\u59d3\u540d\uff09\uff0csoshi.sato: ~\/ %\u662f\u63d0\u793a\u7b26\u5bf9\u5427\u3002<br \/>\n\u63a5\u4e0b\u6765\u6211\u4f1a\u6309\u7167\u8fd9\u79cd\u611f\u89c9\u7ee7\u7eed\u5199\u3002<\/p>\n<pre class=\"post-pre\"><code>soshi.sato: ~\/ % brew install git\r\n<\/code><\/pre>\n<p>\u867d\u7136\u6ca1\u6709\u5f39\u51fa\u4ec0\u4e48&#8221;Success!!!!&#8221;\u7684\u6d88\u606f\uff0c\u4f46\u5b89\u88c5\u5df2\u7ecf\u5b8c\u6210\u4e86\u3002<br \/>\n\u4e0a\u9762\u5199\u7740&#8221;Complete\u4e91\u4e91&#8221;\u3002<\/p>\n<pre class=\"post-pre\"><code>soshi.sato: ~\/ % git version\r\ngit version 2.37.3\r\n<\/code><\/pre>\n<h2>\u521b\u5efa\u5b58\u50a8\u5e93<\/h2>\n<p>\u521b\u5efa\u4e00\u4e2a\u975e\u5e38\u5408\u9002\u7684\u5b58\u50a8\u5e93\u3002<br \/>\n\u53ea\u653e\u7f6e\u4e86README\u6587\u4ef6\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>5. \u8fdb\u884cGit<\/h2>\n<p>\u6211\u5728\u8fd9\u91cc\u68c0\u67e5\u81ea\u5df1\u5199\u7684\u6587\u7ae0\uff0c\u867d\u7136\u5185\u5bb9\u5f88\u7cdf\u7cd5\uff0c\u4f46\u6211\u60f3\u8868\u626c\u4e00\u4e0b\u5f53\u65f6\u5199\u4f5c\u7684\u81ea\u5df1\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>5-1. \u514b\u9686\u5b58\u50a8\u5e93<\/h3>\n<p>\u6211\u4f1a\u514b\u9686\u5230\u672c\u5730\u3002<\/p>\n<pre class=\"post-pre\"><code>soshi.sato: ~\/ % git clone https:\/\/github.com\/sosat117\/remember_git\r\n\r\n<\/code><\/pre>\n<h3>5-2.\u67e5\u770bgit\u72b6\u6001\u4ee5\u53ca\u5206\u652f<\/h3>\n<p>\u8bb0\u5f97\u5207\u6362\u5230remember_git\u5b58\u50a8\u5e93\uff0c\u8fdb\u884c\u5404\u79cd\u786e\u8ba4\u3002<\/p>\n<pre class=\"post-pre\"><code>soshi.sato: ~\/ % cd remember_git\r\nsoshi.sato: remember_git\/ % git status\r\nOn branch main\r\nYour branch is up to date with 'origin\/main'.\r\n\r\nnothing to commit, working tree clean\r\n\r\nsoshi.sato: remember_git\/ % git branch\r\n* main\r\n<\/code><\/pre>\n<p>\u4e3b\u4eba\u800c\u4e0d\u662f\u4e3b\u8981\u7684\u55ce&#8230;\uff1f\u6211\u672c\u4f86\u9084\u4ee5\u70ba\u662f\u4e3b\u8981\u7684\uff0c\u4f46\u73fe\u5728\u4e0d\u5728\u610f\u4e86\u3002<\/p>\n<h3>5-3. \u6211\u4eec\u8981\u526a\u6389\u5206\u652f\u3002<\/h3>\n<p>\u6211\u968f\u4fbf\u5c06\u5b83\u547d\u540d\u4e3amain_cron\u3002<br \/>\n\u4ece\u8fd9\u4e2a\u5730\u65b9\u5f00\u59cb\uff0c\u6211\u5f00\u59cb\u56de\u5fc6\u8d77\u5f53\u65f6\u7684\u611f\u89c9\u4e86\uff0c\u52a8\u624b\u771f\u7684\u5f88\u91cd\u8981\u3002<\/p>\n<p>\u5176\u5b9e\u6211\u521a\u521a\u60f3\u5230\uff0c\u8fd9\u96be\u9053\u4e0d\u662f\u514b\u9686\uff08clone\uff09\u5417\uff1f\u54c7<br \/>\n\u6211\u7684\u82f1\u8bed\u6c34\u5e73\u3002\u3002<\/p>\n<pre class=\"post-pre\"><code>soshi.sato: remember_git\/ % git branch\r\n* main\r\n  main_cron\r\n<\/code><\/pre>\n<h3>5-4. \u5207\u6362\u5206\u652f<\/h3>\n<p>\u5207\u6362\u5230\u4e4b\u524d\u521b\u5efa\u7684 cron\u3002<\/p>\n<pre class=\"post-pre\"><code>soshi.sato: remember_git\/ % git checkout main_cron\r\nSwitched to branch 'main_cron'\r\nsoshi.sato: remember_git\/ % git branch\r\n  main\r\n* main_cron\r\n<\/code><\/pre>\n<p>\u987a\u4fbf\u4e5f\u786e\u8ba4\u4e00\u4e0b\u72b6\u6001\u3002<\/p>\n<pre class=\"post-pre\"><code>soshi.sato: remember_git\/ % git status\r\nOn branch main_cron\r\nnothing to commit, working tree clean\r\n<\/code><\/pre>\n<h3>5-5. \u6dfb\u52a0\u6d4b\u8bd5\u6587\u4ef6<\/h3>\n<p>\u4f7f\u7528vi\u6dfb\u52a0\u4e00\u4e2a\u9002\u5f53\u7684\u6587\u4ef6\u3002<\/p>\n<pre class=\"post-pre\"><code>soshi.sato: remember_git\/ % vi otameshi_git.txt\r\nsoshi.sato: remember_git\/ % ls -lha\r\ntotal 16\r\ndrwxr-xr-x   5 soshi.sato  staff   160B  9 28 17:01 .\r\ndrwxr-x---+ 22 soshi.sato  staff   704B  9 28 17:01 ..\r\ndrwxr-xr-x  12 soshi.sato  staff   384B  9 28 16:58 .git\r\n-rw-r--r--   1 soshi.sato  staff    63B  9 28 16:41 README.md\r\n-rw-r--r--   1 soshi.sato  staff    49B  9 28 17:01 otameshi_git.txt\r\nsoshi.sato: remember_git\/ % cat otameshi_git.txt\r\nThis file is otameshi-text.\r\nwritten by ssato117.\r\n<\/code><\/pre>\n<h3>5-6. \u67e5\u770b\u72b6\u6001<\/h3>\n<p>\u662f\u7ea2\u8272\u7684\u3002<\/p>\n<pre class=\"post-pre\"><code>soshi.sato: remember_git\/ % git status\r\nOn branch main_cron\r\nUntracked files:\r\n  (use \"git add &lt;file&gt;...\" to include in what will be committed)\r\n\totameshi_git.txt\r\n\r\nnothing added to commit but untracked files present (use \"git add\" to track)\r\n<\/code><\/pre>\n<h3>5-7. \u6dfb\u52a0\u5230git<\/h3>\n<p>\u6dfb\u52a0\u3002\u8fd9\u6b21\u6587\u4ef6\u540d\u662f\u56fa\u5b9a\u7684\u3002\u72b6\u6001\u662f\u6309\u7167\u6d41\u7a0b\u6765\u7684\u3002\u662f\u7eff\u8272\u7684\u3002<\/p>\n<pre class=\"post-pre\"><code>soshi.sato: remember_git\/ % git add otameshi_git.txt\r\nsoshi.sato: remember_git\/ % git status\r\nOn branch main_cron\r\nChanges to be committed:\r\n  (use \"git restore --staged &lt;file&gt;...\" to unstage)\r\n\tnew file:   otameshi_git.txt\r\n<\/code><\/pre>\n<h3>5\u67088\u65e5\u7684\u4e8b\u60c5<\/h3>\n<p>\u6211\u5f88\u9ad8\u5174\u5730\u5b8c\u6210\u4e86commit\u8fd9\u4ef6\u4e8b\u3002<\/p>\n<pre class=\"post-pre\"><code>soshi.sato: remember_git\/ % git commit -m \"add otameshi_git.txt\"\r\n[main_cron 1d319fc] add otameshi_git.txt\r\n Committer: soshi.sato &lt;soshi.sato@soshisatonoMBP.usen.ad.jp&gt;\r\nYour name and email address were configured automatically based\r\non your username and hostname. Please check that they are accurate.\r\nYou can suppress this message by setting them explicitly. Run the\r\nfollowing command and follow the instructions in your editor to edit\r\nyour configuration file:\r\n\r\n    git config --global --edit\r\n\r\nAfter doing this, you may fix the identity used for this commit with:\r\n\r\n    git commit --amend --reset-author\r\n\r\n 1 file changed, 2 insertions(+)\r\n create mode 100644 otameshi_git.txt\r\n\r\n<\/code><\/pre>\n<p>soshi.sato@soshisatonoMBP.usen.ad.jp\u7684\u6837\u5b50\u771f\u7684\u592a\u7cdf\u7cd5\u4e86\u5427\uff0c\u8fd9\u4e0b\u53c8\u591a\u4e86\u4e00\u4e2a\u95ee\u9898\u3002\u3002<\/p>\n<p>\u54e6\uff0ccommit\u7684-m\u6d88\u606f\u603b\u662f\u4f7f\u7528&#8221;add&#8221;\u6216&#8221;modify&#8221;\u540e\u9762\u63a5\u6587\u4ef6\u540d\u7684\u5f62\u5f0f\u3002\u8fd9\u65b9\u9762\u5e94\u8be5\u6709\u6700\u4f73\u5b9e\u8df5\u3002\u4ee5\u540e\u4f1a\u53bb\u641c\u7d22\u4e00\u4e0b\u3002<\/p>\n<p>\u72b6\u6001\u4e5f\u786e\u8ba4\u4e00\u4e0b\u3002\u53d8\u5f97\u5f88\u6f02\u4eae\u554a\uff01<\/p>\n<pre class=\"post-pre\"><code>soshi.sato: remember_git\/ % git status\r\nOn branch main_cron\r\nnothing to commit, working tree clean\r\n<\/code><\/pre>\n<h3>5-9\u63a8\u52a8<\/h3>\n<p>\u6709\u4ec0\u4e48\u4e8b\u60c5\u53d1\u751f\u4e86\u3002<\/p>\n<pre class=\"post-pre\"><code>soshi.sato: remember_git\/ % git push origin main_cron\r\nUsername for 'https:\/\/github.com': sosat117\r\nPassword for 'https:\/\/sosat117@github.com':\r\nremote: Support for password authentication was removed on August 13, 2021.\r\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\r\nfatal: Authentication failed for 'https:\/\/github.com\/sosat117\/remember_git\/'\r\n<\/code><\/pre>\n<p>\u6839\u636e\u5b98\u65b9\uff0c\u5bc6\u7801\u8ba4\u8bc1\u5728\u53bb\u5e748\u6708\u4efd\u5df2\u7ecf\u7ed3\u675f\uff01\uff01\uff01\uff01\uff01<\/p>\n<p>&nbsp;<\/p>\n<p>\u5982\u679c\u6211\u7b80\u8981\u67e5\u770b\u4e00\u4e0b\u7684\u8bdd\uff0c\u4f3c\u4e4e\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u5bc6\u94a5\u5bf9\u6765\u8fdb\u884c\u8ba4\u8bc1\u3002\u6211\u4f1a\u5c1d\u8bd5\u4e00\u4e0b\u3002<\/p>\n<h2>\u5728\u6b64\u4e4b\u524d\uff0c\u5c0dinit\u9032\u884c\u4e86\u504f\u96e2\u5904\u7406\u3002<\/h2>\n<p>\u514b\u9686\u8fdc\u7a0b\u4ed3\u5e93\u6216\u8005\u521d\u59cb\u5316\u672c\u5730\u4ed3\u5e93\u6709\u5f88\u591a\u65b9\u6cd5\uff0c\u6211\u4e2a\u4eba\u51e0\u4e4e\u6ca1\u6709\u4f7f\u7528init\uff0c\u6240\u4ee5\u5c1d\u8bd5\u4e86\u4e00\u4e0b\u3002<\/p>\n<h3>6-1.\u521d\u59cb\u5316git<\/h3>\n<p>\u8d85\u7ea7\u9ec4\u3002<\/p>\n<pre class=\"post-pre\"><code>soshi.sato: ~\/ % git init remember_git2\r\nhint: Using 'master' as the name for the initial branch. This default branch name\r\nhint: is subject to change. To configure the initial branch name to use in all\r\nhint: of your new repositories, which will suppress this warning, call:\r\nhint:\r\nhint: \tgit config --global init.defaultBranch &lt;name&gt;\r\nhint:\r\nhint: Names commonly chosen instead of 'master' are 'main', 'trunk' and\r\nhint: 'development'. The just-created branch can be renamed via this command:\r\nhint:\r\nhint: \tgit branch -m &lt;name&gt;\r\nInitialized empty Git repository in \/Users\/soshi.sato\/remember_git2\/.git\/\r\n\r\n<\/code><\/pre>\n<p>\u5728\u5305\u542b.git\u6587\u4ef6\u7684\u76ee\u5f55\u4e2d\u771f\u662f\u4ee4\u4eba\u5f00\u5fc3\u5462w<\/p>\n<pre class=\"post-pre\"><code>soshi.sato: remember_git2\/ % ls -lha\r\ntotal 0\r\ndrwxr-xr-x   3 soshi.sato  staff    96B  9 29 10:40 .\r\ndrwxr-x---+ 24 soshi.sato  staff   768B  9 29 10:40 ..\r\ndrwxr-xr-x   9 soshi.sato  staff   288B  9 29 10:40 .git\r\n<\/code><\/pre>\n<p>\u56e0\u4e3a\u63d0\u793a\u4e0a\u5199\u7740\u201cmaster\u201d\u548c\u201cmain\u201d\uff0c\u6240\u4ee5\u6211\u67e5\u4e86\u4e00\u4e0b\u3002\u636e\u8bf4\uff0c\u7531\u4e8e\u201cmaster\u201d\u548c\u201cslave\u201d\u8ba9\u4eba\u8054\u60f3\u5230\u5974\u96b6\u5236\u5ea6\uff0c\u6240\u4ee5\u6539\u6210\u4e86\u201cmain\u201d\u3002\u6211\u5b8c\u5168\u540c\u611f\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u5982\u679c\u6709\u4eba\u53ef\u80fd\u611f\u5230\u4e0d\u8212\u670d\u7684\u8bdd\uff0c\u6211\u4eec\u5e94\u8be5\u907f\u514d\u8fd9\u6837\u505a\uff0c\u8fd9\u79cd\u601d\u60f3\u6210\u4e3a\u6807\u51c6\u5c31\u597d\u4e86\uff01<\/p>\n<h2>7. \u518d\u6b21\u63a8\u52a8<\/h2>\n<p>\u9605\u8bfb\u516c\u5f0f\u4e4b\u540e\uff0c\u53ef\u4ee5\u4ece\u56fe\u5f62\u7528\u6237\u754c\u9762\u521b\u5efa\u4ee4\u724c\u3002<\/p>\n<p>\u6309\u7167\u8d85\u7ea7\u7b80\u5355\u6613\u61c2\u7684\u6b65\u9aa4\u521b\u5efa\u4ee4\u724c\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u8f93\u5165\u6b64\u4ee4\u724c\u4e3a\u5bc6\u7801\u5e76\u6210\u529f\uff01\u592a\u68d2\u4e86\uff01\uff01<\/p>\n<pre class=\"post-pre\"><code>soshi.sato: remember_git\/ % git push origin main_cron\r\nUsername for 'https:\/\/github.com': sosat117\r\nPassword for 'https:\/\/sosat117@github.com':\r\nEnumerating objects: 4, done.\r\nCounting objects: 100% (4\/4), done.\r\nDelta compression using up to 8 threads\r\nCompressing objects: 100% (2\/2), done.\r\nWriting objects: 100% (3\/3), 347 bytes | 347.00 KiB\/s, done.\r\nTotal 3 (delta 0), reused 0 (delta 0), pack-reused 0\r\nremote:\r\nremote: Create a pull request for 'main_cron' on GitHub by visiting:\r\nremote:      https:\/\/github.com\/sosat117\/remember_git\/pull\/new\/main_cron\r\nremote:\r\nTo https:\/\/github.com\/sosat117\/remember_git\r\n * [new branch]      main_cron -&gt; main_cron\r\n<\/code><\/pre>\n<p>\u770b\u5230GUI\uff0c\u53d1\u73b0\u6dfb\u52a0\u4e86\u4e00\u4e2a\u5207\u5272\u7684\u5206\u652f\u3002\u5b8c\u7f8e\u3002<br \/>\n\u56e0\u4e3a\u5927\u81f4\u80fd\u731c\u5230Pull Request\u7684\u60c5\u51b5\uff0c\u6240\u4ee5\u4e0d\u4f1a\u53bb\u505a\u4e86\u3002<\/p>\n<h2>8. \u5173\u4e8e.DS_Store\u6587\u4ef6\u7684\u9038\u8131\u95ee\u9898<\/h2>\n<p>\u5f53\u6211\u4eceMac\u4e0a\u8fdb\u884cpush\u64cd\u4f5c\u65f6\uff0c\u6211\u5e38\u5e38\u4f1a\u5c06.DS_Store\u6587\u4ef6\u4e00\u5e76\u4e0a\u4f20\uff0c\u8fd9\u8ba9\u6211\u60f3\u8d77\u4e86\u8fd9\u4e00\u70b9\u3002<br \/>\n\u4f46\u662f\u6211\u6ce8\u610f\u5230\uff0c\u65e0\u8bba\u662f\u514b\u9686\u8fc7\u6765\u7684\u672c\u5730\u4ee3\u7801\u5e93\uff0c\u8fd8\u662f\u521d\u59cb\u8fc7\u7684\u672c\u5730\u4ee3\u7801\u5e93\u90fd\u4e0d\u5b58\u5728\u8be5\u6587\u4ef6\u3002<\/p>\n<p>\u53ea\u662f\u611f\u89c9\u50cf\u662f\u5728\u5e38\u89c1\u7684\u4e3b\u76ee\u5f55\u4e0b\uff01\u6240\u4ee5\uff0c\u662f\u6709\u4ec0\u4e48\u53d8\u5316\u5417&#8230;\uff1f<br \/>\n\u8fd9\u6b21\u5c31\u53ea\u8c03\u67e5\u4e86\u4e00\u4e0bDS_Store\u662f\u4ec0\u4e48\u4e1c\u897f\u5e76\u4e14\u600e\u4e48\u5220\u9664\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>9. \u6700\u540e<\/h2>\n<p>\u5f53\u6211\u5f00\u59cb\u52a8\u624b\u505a\u7684\u65f6\u5019\uff0c\u8bb0\u5fc6\u4e5f\u968f\u4e4b\u590d\u82cf\u3002\u800c\u4e14Github\u7684\u8fdb\u5316\u901f\u5ea6\u771f\u7684\u5f88\u5feb\u3002<br \/>\n\u654f\u611f\u7684\u90e8\u5206\u4e5f\u5f97\u5230\u4e86\u6539\u5584\uff0c\u8ba9\u6211\u66f4\u52a0\u559c\u6b22\u8fd9\u9879\u670d\u52a1\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u6211\u5728\u524d\u8f88\u4eec\u7684\u535a\u5ba2\u4e2d\u4e5f\u5f97\u5230\u4e86\u5f88\u591a\u5e2e\u52a9\u3002\u5728\u8fd9\u91cc\u501f\u673a\u8868\u793a\u611f\u8c22\uff01\u679c\u7136\u5de5\u7a0b\u5e08\u4eec\u7684\u96c6\u4f53\u667a\u6167\u662f\u6700\u68d2\u7684\u3002<\/p>\n<p>\u7531\u4e8e\u5c1a\u6709\u8bb8\u591a\u4e0d\u4e86\u89e3\u7684\u5730\u65b9\uff0c\u5982\u51b2\u7a81\u7b49\u95ee\u9898\uff0c\u6211\u5c06\u7ee7\u7eed\u52aa\u529b\u5b66\u4e60Git\u7684\u9053\u8def\uff01<\/p>\n<h2>10. \u8865\u5145\u8bb0\u5f55<\/h2>\n<p>\u5220\u9664\u6587\u4ef6\u65f6\u4f7f\u7528git rm\u800c\u4e0d\u662frm\u3002<br \/>\n\u6211\u611f\u5230\u56f0\u60d1\u3002\u3002w<\/p>\n<p>\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148 \u6211\u5fd8\u8bb0\u4e86\u5982\u4f55\u4f7f\u7528Git\u3002\u6240\u4ee5\u8ba9\u6211\u4eec\u4e00\u8d77\u56de\u5fc6\u4e00\u4e0b\u5427~ \u8fd9\u53ea\u662f\u4e00\u4e2a\u5f88\u7b80\u5355\u7684\u6587\u7ae0\uff0c\u8bf7\u60a8\u8c05\u89e3\uff01 \u6211\u4f7f\u7528\u4e86\u65b0\u8cb7\u7684M [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-37342","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u6211\u8981\u8ba9\u4f60\u60f3\u8d77Git - Blog - Silicon Cloud<\/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.silicloud.com\/zh\/blog\/\u6211\u8981\u8ba9\u4f60\u60f3\u8d77git\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u6211\u8981\u8ba9\u4f60\u60f3\u8d77Git\" \/>\n<meta property=\"og:description\" content=\"\u9996\u5148 \u6211\u5fd8\u8bb0\u4e86\u5982\u4f55\u4f7f\u7528Git\u3002\u6240\u4ee5\u8ba9\u6211\u4eec\u4e00\u8d77\u56de\u5fc6\u4e00\u4e0b\u5427~ \u8fd9\u53ea\u662f\u4e00\u4e2a\u5f88\u7b80\u5355\u7684\u6587\u7ae0\uff0c\u8bf7\u60a8\u8c05\u89e3\uff01 \u6211\u4f7f\u7528\u4e86\u65b0\u8cb7\u7684M [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u6211\u8981\u8ba9\u4f60\u60f3\u8d77git\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-09-18T16:31:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-15T01:25:03+00:00\" \/>\n<meta name=\"author\" content=\"\u5b87, \u534e\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u5b87, \u534e\" \/>\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.silicloud.com\/zh\/blog\/%e6%88%91%e8%a6%81%e8%ae%a9%e4%bd%a0%e6%83%b3%e8%b5%b7git\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e8%a6%81%e8%ae%a9%e4%bd%a0%e6%83%b3%e8%b5%b7git\/\",\"name\":\"\u6211\u8981\u8ba9\u4f60\u60f3\u8d77Git - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-09-18T16:31:59+00:00\",\"dateModified\":\"2024-01-15T01:25:03+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e8%a6%81%e8%ae%a9%e4%bd%a0%e6%83%b3%e8%b5%b7git\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e8%a6%81%e8%ae%a9%e4%bd%a0%e6%83%b3%e8%b5%b7git\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e8%a6%81%e8%ae%a9%e4%bd%a0%e6%83%b3%e8%b5%b7git\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u6211\u8981\u8ba9\u4f60\u60f3\u8d77Git\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\",\"name\":\"\u5b87, \u534e\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"caption\":\"\u5b87, \u534e\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e8%a6%81%e8%ae%a9%e4%bd%a0%e6%83%b3%e8%b5%b7git\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u6211\u8981\u8ba9\u4f60\u60f3\u8d77Git - Blog - Silicon Cloud","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.silicloud.com\/zh\/blog\/\u6211\u8981\u8ba9\u4f60\u60f3\u8d77git\/","og_locale":"zh_CN","og_type":"article","og_title":"\u6211\u8981\u8ba9\u4f60\u60f3\u8d77Git","og_description":"\u9996\u5148 \u6211\u5fd8\u8bb0\u4e86\u5982\u4f55\u4f7f\u7528Git\u3002\u6240\u4ee5\u8ba9\u6211\u4eec\u4e00\u8d77\u56de\u5fc6\u4e00\u4e0b\u5427~ \u8fd9\u53ea\u662f\u4e00\u4e2a\u5f88\u7b80\u5355\u7684\u6587\u7ae0\uff0c\u8bf7\u60a8\u8c05\u89e3\uff01 \u6211\u4f7f\u7528\u4e86\u65b0\u8cb7\u7684M [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u6211\u8981\u8ba9\u4f60\u60f3\u8d77git\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-09-18T16:31:59+00:00","article_modified_time":"2024-01-15T01:25:03+00:00","author":"\u5b87, \u534e","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u5b87, \u534e","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e8%a6%81%e8%ae%a9%e4%bd%a0%e6%83%b3%e8%b5%b7git\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e8%a6%81%e8%ae%a9%e4%bd%a0%e6%83%b3%e8%b5%b7git\/","name":"\u6211\u8981\u8ba9\u4f60\u60f3\u8d77Git - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-09-18T16:31:59+00:00","dateModified":"2024-01-15T01:25:03+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e8%a6%81%e8%ae%a9%e4%bd%a0%e6%83%b3%e8%b5%b7git\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e8%a6%81%e8%ae%a9%e4%bd%a0%e6%83%b3%e8%b5%b7git\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e8%a6%81%e8%ae%a9%e4%bd%a0%e6%83%b3%e8%b5%b7git\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u6211\u8981\u8ba9\u4f60\u60f3\u8d77Git"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458","name":"\u5b87, \u534e","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","caption":"\u5b87, \u534e"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e8%a6%81%e8%ae%a9%e4%bd%a0%e6%83%b3%e8%b5%b7git\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=37342"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37342\/revisions"}],"predecessor-version":[{"id":58183,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37342\/revisions\/58183"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=37342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=37342"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=37342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}