{"id":160,"date":"2022-09-07T15:38:02","date_gmt":"2022-09-07T07:38:02","guid":{"rendered":"http:\/\/weboob.top\/blog\/?p=160"},"modified":"2022-09-07T15:38:02","modified_gmt":"2022-09-07T07:38:02","slug":"git%e4%bd%bf%e7%94%a8%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"http:\/\/blog.weboob.top\/?p=160","title":{"rendered":"Git\u4f7f\u7528\u4ecb\u7ecd"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"%E4%B8%80git%E6%98%AF%E4%BB%80%E4%B9%88\">\u4e00\u3001Git\u662f\u4ec0\u4e48<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Git\u662f\u4e00\u4e2a\u514d\u8d39<a href=\"https:\/\/git-scm.com\/\">\u5f00\u6e90<\/a>\u7684\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u6709Linux Torvaldds\u4e3a\u5e2e\u52a9\u7ba1\u7406Linux\u5185\u6838\u5f00\u53d1\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"%E4%BA%8Cgit%E4%B8%8Esvncvs%E7%9A%84%E5%8C%BA%E5%88%AB\">\u4e8c\u3001Git\u4e0eSVN\u3001CVS\u7684\u533a\u522b<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>SVN\/CVS\uff0c\u96c6\u4e2d\u5f0f\u5b58\u50a8\uff0c\u6709\u4e2d\u592e\u670d\u52a1\u5668\uff0c\u5fc5\u987b\u8054\u7f51\u624d\u80fd\u4f7f\u7528\uff0c\u5982\u679c\u4e2d\u592e\u670d\u52a1\u5668\u762b\u75ea\uff0c\u4efb\u4f55\u4eba\u90fd\u5e94\u7528\u4e0d\u4e86\uff08\u57fa\u4e8e\u6587\u4ef6\u5dee\u5f02\u7684\u7248\u672c\u63a7\u5236\uff09<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image is-style-default\"><img decoding=\"async\" src=\"http:\/\/picbed.weboob.top\/blog\/20220704204455-2022-07-04-20-44-55.png\" alt=\"20220704204455-2022-07-04-20-44-55\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Git \u5206\u5e03\u5f0f\u5b58\u50a8\uff0c\u6ca1\u6709\u4e2d\u592e\u670d\u52a1\u5668\uff0c\u6bcf\u4e2a\u4eba\u7684\u526f\u672c\u7684\u90fd\u662f\u5b8c\u6574\u7684\u3002\uff08\u7248\u672c\u6587\u4ef6\u5feb\u7167\uff09<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image is-style-default\"><img decoding=\"async\" src=\"http:\/\/picbed.weboob.top\/blog\/20220704204517-2022-07-04-20-45-17.png\" alt=\"20220704204517-2022-07-04-20-45-17\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"%E4%B8%89git%E7%9A%84%E5%B7%A5%E4%BD%9C%E6%B5%81%E7%A8%8B\">\u4e09\u3001Git\u7684\u5de5\u4f5c\u6d41\u7a0b<\/h2>\n\n\n\n<figure class=\"wp-block-image is-style-default\"><img decoding=\"async\" src=\"http:\/\/picbed.weboob.top\/blog\/20220704204557-2022-07-04-20-45-57.png\" alt=\"20220704204557-2022-07-04-20-45-57\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>workspace\uff1a\u5de5\u4f5c\u533a<\/li><li>Index\/Stage\uff1a\u6682\u5b58\u533a\uff08\u4e00\u822c\u5728<code>.git<\/code>\u76ee\u5f55\u4e0b\u7684index\u4e2d \uff09<\/li><li>Repository\uff1a\u7248\u672c\u5e93\uff08<code>.git<\/code>\uff09<\/li><li>Remote\uff1a\u8fdc\u7a0b\u7248\u672c\u5e93<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"%E5%9B%9Bgit%E7%9A%84%E5%AE%89%E8%A3%85\">\u56db\u3001Git\u7684\u5b89\u88c5<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b89\u88c5<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo apt install git\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u914d\u7f6e(\u5168\u5c40)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git config --global user.name \"Youre Name\"\n$ git config --global user.email \"email@example.com\"\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u67e5\u770b\u914d\u7f6e<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git config --list\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"%E4%BA%94git%E7%9A%84%E4%BD%BF%E7%94%A8\">\u4e94\u3001Git\u7684\u4f7f\u7528<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>\u65b0\u5efa\u76ee\u5f55\uff0c\u521d\u59cb\u5316\u4e3agit\u4ed3\u5e93\uff08repository\uff09<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>$ mkdir git_learn\n$ git init\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u521d\u59cb\u5316\u540e\u7684\u5185\u5bb9\u5982\u4e0b<\/p><\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>.\n\u2514\u2500\u2500 .git\n    \u251c\u2500\u2500 branches\n    \u251c\u2500\u2500 config\n    \u251c\u2500\u2500 description\n    \u251c\u2500\u2500 HEAD\n    \u251c\u2500\u2500 hooks\n    \u2502&nbsp;&nbsp; \u251c\u2500\u2500 applypatch-msg.sample\n    \u2502&nbsp;&nbsp; \u251c\u2500\u2500 commit-msg.sample\n    \u2502&nbsp;&nbsp; \u251c\u2500\u2500 fsmonitor-watchman.sample\n    \u2502&nbsp;&nbsp; \u251c\u2500\u2500 post-update.sample\n    \u2502&nbsp;&nbsp; \u251c\u2500\u2500 pre-applypatch.sample\n    \u2502&nbsp;&nbsp; \u251c\u2500\u2500 pre-commit.sample\n    \u2502&nbsp;&nbsp; \u251c\u2500\u2500 prepare-commit-msg.sample\n    \u2502&nbsp;&nbsp; \u251c\u2500\u2500 pre-push.sample\n    \u2502&nbsp;&nbsp; \u251c\u2500\u2500 pre-rebase.sample\n    \u2502&nbsp;&nbsp; \u251c\u2500\u2500 pre-receive.sample\n    \u2502&nbsp;&nbsp; \u2514\u2500\u2500 update.sample\n    \u251c\u2500\u2500 info\n    \u2502&nbsp;&nbsp; \u2514\u2500\u2500 exclude\n    \u251c\u2500\u2500 objects\n    \u2502&nbsp;&nbsp; \u251c\u2500\u2500 info\n    \u2502&nbsp;&nbsp; \u2514\u2500\u2500 pack\n    \u2514\u2500\u2500 refs\n        \u251c\u2500\u2500 heads\n        \u2514\u2500\u2500 tags\n\n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>\u6dfb\u52a0\u6587\u4ef6<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>$ vim readme.txt\n<em># Git is a version control system.<\/em>\n<em># Git is free software.<\/em>\n$ git add readme.txt\n$ git commit -m \"wrote a readme file\"\n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li>\u4fee\u6539\u6587\u4ef6<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>$ vim readme.txt\n<em># Git is a distributed version control system.<\/em>\n<em># Git is free software.<\/em>\n$ git status\n<em># \u67e5\u770b\u5f53\u524d\u5de5\u4f5c\u533a\u72b6\u6001<\/em>\n$ git diff\n<em>#\u67e5\u770b\u5177\u4f53\u6539\u52a8\u5185\u5bb9<\/em>\n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\"><li>\u67e5\u770b\u5386\u53f2\u63d0\u4ea4\u4fe1\u606f<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git log\n<em># \u7b80\u5316\u7248\u672c<\/em>\n$ git log --pretty=oneline\n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"5\"><li>\u6062\u590d\u5230\u67d0\u4e2a\u5feb\u7167(commit)\u7248\u672c<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">HEAD\u5c31\u662f\u6307\u9488\uff08commit_id\uff09<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>HEAD<\/code>\uff1a\u5f53\u524d\u7248\u672c<\/li><li><code>HEAD^<\/code>\uff1a\u4e0a\u4e00\u4e2a\u7248\u672c<\/li><li><code>HEAD^<\/code>\uff1a\u4e0a\u4e0a\u4e00\u4e2a\u7248\u672c<\/li><li><code>HEAD~100<\/code>\uff1a\u5f80\u524d\u6570100\u4e2a\u7248\u672c<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git reset --hard HEAD^\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u9700\u8981\u8fd4\u56de\u6700\u65b0\u7248\u672c\u65f6\uff0c\u6267\u884c<code>git reflog<\/code>\u67e5\u770b\u5386\u53f2\u63d0\u4ea4\u8bb0\u5f55<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git reflog\n$ git reset --hard commit_id\n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"6\"><li>\u5de5\u4f5c\u533a\u548c\u6682\u5b58\u533a<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image is-style-default\"><img decoding=\"async\" src=\"http:\/\/picbed.weboob.top\/blog\/20220704221530-2022-07-04-22-15-30.png\" alt=\"20220704221530-2022-07-04-22-15-30\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><code>git add<\/code>\u4e4b\u540e\u7684\u4fee\u6539\u4e0d\u4f1a\u88ab<code>commit<\/code>\uff0c\u6bcf\u6b21\u4fee\u6539\u5b8c\u5fc5\u987badd\u5230stage\u533a\u57df\uff0c\u624d\u80fd\u522bcommit<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"7\"><li>\u64a4\u9500\u66f4\u6539<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u64a4\u9500\u5de5\u4f5c\u533a\u7684\u66f4\u6539\uff08\u4fee\u6539\u6587\u4ef6\u540e\u672a\u8fdb\u884cadd\uff09<\/em>\n$ git checkout -- &lt;file&gt;\n\n<em># \u64a4\u9500stage\u533a\u57df\u7684\u66f4\u6539\uff08\u4fee\u6539\u6587\u4ef6\u540e\u8fdb\u884c\u4e86add\uff09<\/em>\n$ git reset HEAD &lt;file&gt;\n$ git checkout -- &lt;file&gt;\n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"8\"><li>\u5220\u9664\u6587\u4ef6<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f53\u5728<code>workspace<\/code>\u4e2d\u5220\u9664\u4e86\u67d0\u4e2a\u6587\u4ef6\u65f6\uff0c\u9700\u8981\u63a8\u9001\u6b64\u4fee\u6539\u5230\u4ed3\u5e93<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git rm &lt;file&gt;\n$ git commit -m \"xxxx\"\n\n<em># \u5982\u679c\u8bef\u5220\u9664\uff0c\u5c31\u7528checkout\u6062\u590d<\/em>\n$ git checkout -- &lt;file&gt;\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"%E5%85%AD%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93%E7%9A%84%E4%BD%BF%E7%94%A8\">\u516d\u3001\u8fdc\u7a0b\u4ed3\u5e93\u7684\u4f7f\u7528<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u4f7f\u7528gitee\u521b\u5efa\u6d4b\u8bd5\u4ed3\u5e93\uff0cssh\u767b\u5f55<\/p><\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u5173\u8054\u672c\u5730\u4ed3\u5e93 &lt;--&gt; \u8fdc\u7a0b\u4ed3\u5e93<\/em>\n$  git remote add origin git@gitee.com:weboob\/gittest.git\n\n<em># \u63a8\u9001\u5206\u652fmaster\u5230\u8fdc\u7a0b<\/em>\n$ git push -u origin master\n\n<em># \u540e\u7eed\u63a8\u9001<\/em>\n$ git push origin master\n\n<em># \u5220\u9664\u5173\u8054\u4ed3\u5e93\u4fe1\u606f\uff08\u5148\u67e5\u770b\u5df2\u7ed1\u5b9a\u4fe1\u606f\uff09<\/em>\n$ git remote -v\n<em>#origin  git@gitee.com:weboob\/gittest.git (fetch)<\/em>\n<em>#origin  git@gitee.com:weboob\/gittest.git (push)<\/em>\n\n$ git remote rm origin\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>origin \u662f\u8fdc\u7a0b\u4ed3\u5e93\u7684\u540d\u5b57\uff0c\u540e\u7eed\u6240\u6709\u7684\u64cd\u4f5c\u90fd\u662f\u4f7f\u7528\u8fd9\u4e2a\u522b\u540d\u3002<\/p><\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u590d\u5236\u8fdc\u7a0b\u4ed3\u5e93<\/em>\n$ git clone git@gitee.com:weboob\/gittest.git\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"%E4%B8%83%E5%88%86%E6%94%AF%E7%9A%84%E7%AE%A1%E7%90%86\">\u4e03\u3001\u5206\u652f\u7684\u7ba1\u7406<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5206\u652f\u7684\u5207\u6362\u672c\u8d28\u4e0a\u662f\u6307\u9488\u7684\u53d8\u52a8\uff0c\u6240\u4ee5\u5f88\u5feb&nbsp;<img decoding=\"async\" src=\"http:\/\/picbed.weboob.top\/blog\/20220705134842-2022-07-05-13-48-42.png\" alt=\"20220705134842-2022-07-05-13-48-42\"><\/p>\n\n\n\n<figure class=\"wp-block-image is-style-default\"><img decoding=\"async\" src=\"http:\/\/picbed.weboob.top\/blog\/image.png-2022-07-05-13-49-44.png\" alt=\"image.png-2022-07-05-13-49-44\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image is-style-default\"><img decoding=\"async\" src=\"http:\/\/picbed.weboob.top\/blog\/20220705135024-2022-07-05-13-50-24.png\" alt=\"20220705135024-2022-07-05-13-50-24\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1%E5%88%86%E6%94%AF%E5%88%87%E6%8D%A2\">1.\u5206\u652f\u5207\u6362<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><em># -b \u53c2\u6570\u4ee3\u8868\u521b\u5efa\u5e76\u7acb\u5373\u5207\u6362\uff0c\u76f8\u5f53\u4e8e\u4ee5\u4e0b\u4e24\u6761\u547d\u4ee4<\/em>\n<em># git branch dev<\/em>\n<em># git checkout dev<\/em>\n$ git checkout -b dev\n\n<em># \u65b0\u7248\u672c\u7684git\u652f\u6301switch\u5207\u6362\u547d\u4ee4<\/em>\n<em># \u521b\u5efa\u5e76\u5207\u6362\u5230dev<\/em>\n$ git switch -c dev\n<em># \u5355\u72ec\u5207\u6362\u5230dev<\/em>\n$ git switch master\n\n<em># \u67e5\u770b\u5f53\u524d\u6240\u5728\u5206\u652f<\/em>\n$ git branch\n\n<em># \u5408\u5e76\u5176\u4ed6\u5206\u652f\u5230\u5f53\u524d\u5206\u652f(dev --&gt; master)<\/em>\n<em># \u5148\u5207\u6362\u5230 master \u518d merge<\/em>\n$ git checkout master\n$ git merge dev\n\n<em># \u5220\u9664\u5408\u5e76\u540e\u7684 dev \u5206\u652f<\/em>\n$ git branch -d dev\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">\u5c0f\u7ed3\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u67e5\u770b\u5206\u652f\uff1a<code>git branch<\/code><br \/>\u521b\u5efa\u5206\u652f\uff1a<code>git branch &lt;name&gt;<\/code><br \/>\u5207\u6362\u5206\u652f\uff1a<code>git checkout &lt;name&gt;<\/code>\u6216\u8005<code>git switch &lt;name&gt;<\/code><br \/>\u521b\u5efa+\u5207\u6362\u5206\u652f\uff1a<code>git checkout -b &lt;name&gt;<\/code>\u6216\u8005<code>git switch -c &lt;name&gt;<\/code><br \/>\u5408\u5e76\u67d0\u5206\u652f\u5230\u5f53\u524d\u5206\u652f\uff1a<code>git merge &lt;name&gt;<\/code><br \/>\u5220\u9664\u5206\u652f\uff1a<code>git branch -d &lt;name&gt;<\/code><\/p><\/blockquote>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2-%E5%86%B2%E7%AA%81%E9%97%AE%E9%A2%98\">2. \u51b2\u7a81\u95ee\u9898<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f53\u4e24\u4e2a\u4ee5\u4e0a\u5206\u652f\uff0c\u540c\u65f6\u4fee\u6539\u4e86\u4e00\u5904\uff0c\u5728\u5408\u5e76\u65f6\u4f1a\u5bfc\u81f4\u5408\u5e76\u51b2\u7a81\u3002\u9700\u8981\u4fee\u6539\u6587\u4ef6\u4e2d\u7684\u51b2\u7a81\u90e8\u5206<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Git\u7528<code>&lt;&lt;&lt;&lt;&lt;&lt;&lt;<\/code>\uff0c<code>=======<\/code>\uff0c<code>&gt;&gt;&gt;&gt;&gt;&gt;&gt;<\/code>\u6807\u8bb0\u51fa\u4e0d\u540c\u5206\u652f\u7684\u5185\u5bb9<\/p><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"%E7%84%B6%E5%90%8E%E5%86%8D%E6%AC%A1%E5%90%88%E5%B9%B6\">\u7136\u540e\u518d\u6b21\u5408\u5e76\u3002<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5408\u5e76\u524d\uff1a&nbsp;<img decoding=\"async\" src=\"http:\/\/picbed.weboob.top\/blog\/20220705153001-2022-07-05-15-30-01.png\" alt=\"20220705153001-2022-07-05-15-30-01\"><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">\u5408\u5e76\u540e\uff1a&nbsp;<img decoding=\"async\" src=\"http:\/\/picbed.weboob.top\/blog\/20220705153229-2022-07-05-15-32-29.png\" alt=\"20220705153229-2022-07-05-15-32-29\"><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u67e5\u770b\u5206\u652f\u5e76\u60c5\u51b5<\/em>\n$ git log --graph --pretty=oneline --abbrev-commit\n<em># *   dca33b0 (HEAD -&gt; master) conflict fixed<\/em>\n<em># |\\  <\/em>\n<em># | * bad4407 (feature1) AND simple<\/em>\n<em># * | de9ec49 &amp; simple<\/em>\n<em># |\/  <\/em>\n<em># * e52f88b branch test<\/em>\n<em># * 4bb1906 (origin\/master) del text2.txt<\/em>\n<em># * c19e402 add test2.txt<\/em>\n<em># * 6f1afc4 del test.txt<\/em>\n<em># * b8bb1e8 add test.txt<\/em>\n<em># * 4d35d72 understand how stage works<\/em>\n<em># * 14334e0 append GPL<\/em>\n<em># * ba421f8 add distributed<\/em>\n<em># * 37f1b49 wrote a readme file<\/em>\n\n<em># \u5220\u9664\u591a\u4f59\u5206\u652f<\/em>\n$ git branch -d feature1\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-%E4%BD%BF%E7%94%A8---no-ff-%E6%96%B9%E5%BC%8F%E5%90%88%E5%B9%B6%E5%88%86%E6%94%AF\">3. \u4f7f\u7528&nbsp;<code>--no-ff<\/code>&nbsp;\u65b9\u5f0f\u5408\u5e76\u5206\u652f<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u666e\u901a\u7684\u5408\u5e76\u5206\u652f\u4f7f\u7528&nbsp;<code>Fast forward<\/code>&nbsp;\u7684\u65b9\u5f0f\uff0c\u5982\u679c\u5220\u9664\u5206\u652f\u4f1a\u4e22\u5931\u5206\u652f\u4fe1\u606f\u3002\u53ef\u4ee5\u6307\u5b9a&nbsp;<code>--no-ff<\/code>\u53c2\u6570\uff0c\u5728<code>merge<\/code>\u65f6\u751f\u6210\u65b0\u7684<code>commit<\/code>\u3002<\/p><\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u521b\u5efa\u65b0\u5206\u652f<\/em>\n$ git switch -c dev\n\n<em># \u4fee\u6539\u5185\u5bb9<\/em>\n$ vim readme.txt\n\n<em># \u63d0\u4ea4\u4fe1\u606f<\/em>\n$ git add readme.txt\n$ git commit -m \"add merge\"\n\n<em># \u8fd4\u56demaster<\/em>\n$ git switch master\n\n<em># \u51c6\u5907\u5408\u5e76dev\u5206\u652f<\/em>\n$ git merge --no-ff -m \"merge with no-ff\" dev\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u540e\u56e0\u4e3a\u8981\u751f\u6210\u4e00\u4e2a<code>commit<\/code>\uff0c\u6240\u4ee5\u6307\u5b9a\u4e86&nbsp;<code>-m<\/code>&nbsp;\u53c2\u6570<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u67e5\u770b\u5206\u652f\u5408\u5e76\u60c5\u51b5<\/em>\n$ git log --graph --pretty=oneline --abbrev-commit\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"%E5%88%86%E6%94%AF%E7%AE%A1%E7%90%86%E7%AD%96%E7%95%A5\">\u5206\u652f\u7ba1\u7406\u7b56\u7565<\/h4>\n\n\n\n<figure class=\"wp-block-image is-style-default\"><img decoding=\"async\" src=\"http:\/\/picbed.weboob.top\/blog\/20220705160625-2022-07-05-16-06-25.png\" alt=\"20220705160625-2022-07-05-16-06-25\"\/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><code>master<\/code>\u5206\u652f\u53ea\u7528\u6765\u53d1\u5e03\u65b0\u7684\u7a33\u5b9a\u7248\u672c\u3002\u65e5\u5e38\u5f00\u53d1\u53d1\u5e03\u5230<code>dev<\/code>\u3002\u5c0f\u7ec4\u6210\u5458\u57fa\u4e8e<code>dev<\/code>\uff0c\u65b0\u5efa\u81ea\u5df1\u7684\u5f00\u53d1\u5206\u652f<br \/>\u5408\u5e76\u5206\u652f\u65f6\u4f7f\u7528&nbsp;<code>--no-ff<\/code>\u53c2\u6570\uff0c\u65b9\u4fbf\u4fdd\u7559\u5386\u53f2\u8bb0\u5f55<\/p><\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"4-bug%E5%88%86%E6%94%AF%E4%B8%B4%E6%97%B6%E6%8F%92%E9%98%9F%E4%BB%BB%E5%8A%A1\">4. Bug\u5206\u652f\uff08\u4e34\u65f6\u63d2\u961f\u4efb\u52a1\uff09<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f53\u6709\u4e34\u65f6\u63d2\u961f\u4efb\u52a1\uff0c\u6bd4\u5982\uff1a\u7d27\u6025\u4fee\u590dbug\uff0c\u4f46\u662f\u81ea\u5df1\u7684\u5206\u652f\u5de5\u4f5c\u5c1a\u672a\u5b8c\u5168\u505a\u5b8c\u65e0\u6cd5commit\u3002\u8fd9\u6837\u53ef\u4ee5\u4e34\u65f6<code>stash<\/code>\u5de5\u4f5c\u533a\u548c\u6682\u5b58\u533a\u3002\u7b49\u4ee5\u540e\u518d\u6062\u590d\u73b0\u573a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u6682\u5b58\u5f53\u524d\u5de5\u4f5c\u72b6\u6001<\/em>\n$ git stash\n\n<em># \u5217\u51fa\u5df2\u5b58\u7684\u5de5\u4f5c\u72b6\u6001<\/em>\n$ git stash list\n\n<em># \u6062\u590d stash<\/em>\n$ git stash apply\n<em># \u5220\u9664 \u5df2\u4fdd\u5b58\u7684 stash<\/em>\n$ git stash drop\n\n<em># \u6062\u590d\u5e76\u5220\u9664 stash<\/em>\n$ git stash pop\n\n<em># \u6062\u590d\u6307\u5b9a\u7684 stash<\/em>\n$ git stash apply stash@{0}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u8fc7\u4ecemaster\u521b\u5efabug\u5206\u652f\uff0c\u5e76\u4fee\u590dcommit\u3001merge\u5230master\u540e\uff0c\u53d1\u73b0dev\u5206\u652f\u540c\u6837\u5b58\u5728\u8fd9\u4e2abug\u3002\u8fd9\u662f\u65e0\u9700\u518d\u6b21\u4fee\u6539\u6e90\u6587\u4ef6\uff0c\u53ea\u9700\u5c06master\u4e0a\u63d0\u4ea4\u7684bug\u7684commit\uff0c\u590d\u5236(<code>cherry-pick<\/code>)\u5230dev\u5206\u652f\u5373\u53ef\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git checkout master\n$ git checkout -b issue-101\n$ git add xxx\n$ git commit -m \"xxxxxx\"\n$ git switch master\n$ git merge --no-ff -m \"xxxx\" issue-101\n$ git branch -d issue-101\n<em># \u5047\u8bbe\u4fee\u590dbug\u7684commit_id\u4e3a\uff1a4c805e2<\/em>\n$ git switch dev\n$ git cherry-pick 4c805e2\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u540e\u8bb0\uff1a\u5728\u4fee\u590dbug\u65f6\u9700\u8981\u65b0\u5efabug\u5206\u652f\uff0c\u7136\u540e\u5408\u5e76\uff0c\u5220\u9664\u3002\u591a\u5206\u652f\u4e4b\u95f4\u540c\u4e00bug\u7684\u4fee\u590d\u7528<code>cherry-pick<\/code>\u540c\u6b65\u3002<\/p><\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"5-feature-%E5%88%86%E6%94%AF\">5. Feature \u5206\u652f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u65b0\u529f\u80fd\u7684\u5f00\u53d1\u4e5f\u8ddfbug\u4fee\u590d\u4e00\u6837\u8981\u6709\u81ea\u5df1\u7684\u5206\u652f\uff08feature-xxx\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u521b\u5efa\u65b0\u5206\u652f<\/em>\n$ git switch -c feature-xxx\n\n$ git add xxxx\n$ git commit -m \"xxxx\"\n\n$ git switch dev\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f00\u53d1\u5b8c\u51c6\u5907\u5408\u5e76\u65f6\uff0c\u63a5\u5230\u6d88\u606f \u4e0d\u8981\u8fd9\u4e2a\u529f\u80fd\u4e86\u3002\u6267\u884c\u5220\u9664\u5206\u652f\u547d\u4ee4\uff0c\u9700\u8981\u4f7f\u7528&nbsp;<em><strong>\u5f3a\u5236\u5220\u9664<\/strong><\/em>&nbsp;\u547d\u4ee4\u624d\u53ef\u4ee5<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u8fd9\u6837\u4f1a\u6709\u8b66\u544a\uff0c\u5206\u652f\u5185\u5bb9\u5c1a\u672a\u5408\u5e76<\/em>\n$ git branch -d feature-xxx\n\n<em># \u5f3a\u5236\u5220\u9664\u5206\u652f<\/em>\n$ git branch -D feature-xxx\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"6-%E5%A4%9A%E4%BA%BA%E5%8D%8F%E4%BD%9C\">6. \u591a\u4eba\u534f\u4f5c<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u67e5\u770b\u5efa\u7acb\u8fde\u63a5\u7684\u8fdc\u7a0b\u4ed3\u5e93\u7684\u540d\u79f0<\/em>\n$ git remote\n\n<em># \u67e5\u770b\u5177\u4f53\u7684\u4ed3\u5e93\u5730\u5740<\/em>\n$ git remote -v\n\n<em># \u63a8\u9001dev\u5206\u652f\u5230\u8fdc\u7a0b<\/em>\n$ git push origin dev\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u822c\u6765\u8bf4\uff0c\u5206\u652f\u7684\u63a8\u9001\u770b\u81ea\u5df1\u7684\u9700\u6c42\uff1a&nbsp;<code>master<\/code>\u4e3b\u5206\u652f\uff0c\u9700\u8981\u65f6\u523b\u63a8\u9001\uff1b<code>dev<\/code>\u5f00\u53d1\u5206\u652f\uff0c\u56e2\u961f\u6240\u6709\u6210\u5458\u90fd\u5728\u4e0a\u9762\u5de5\u4f5c\uff0c\u4e00\u822c\u4e5f\u9700\u8981\u63a8\u9001\uff1bbug\u5206\u652f\u548cfeature\u5206\u652f\uff0c\u89c6\u9700\u6c42\u800c\u5b9a\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u4ed6\u4eba\u6bd4\u81ea\u5df1\u5148\u5efa\u7acbdev\u5206\u652f\uff0c\u5e76\u63a8\u9001\u4e86\u4fee\u6539\u6587\u4ef6\uff0c\u800c\u6211\u4eec\u4e5f\u5efa\u7acb\u4e86\u8fd9\u4e2a\u5206\u652f\u5e76\u63a8\u9001\u4e86\u4fee\u6539\u8fc7\u7684\u76f8\u540c\u6587\u4ef6\uff0c\u8fd9\u65f6\u5c31\u4f1a\u51fa\u73b0conflict\uff0c\u9700\u8981\u5728\u672c\u5730\u89e3\u51b3\u51b2\u7a81\uff0c\u518d\u63a8\u9001\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># user1\u521b\u5efa\u672c\u5730dev\u5206\u652f\uff0c\u5e76\u5173\u8054\u8fdc\u7a0bdev\u5206\u652f<\/em>\n$ git checkout -b dev origin\/dev\n\n<em># user2 \u9700\u8981\u5efa\u7acb\u94fe\u63a5<\/em>\n$ git branch --set-upstream-to=origin\/dev dev\n\n<em># \u62c9\u53d6\u8fdc\u7a0b\u6570\u636e<\/em>\n$ git pull\n\n<em># \u4fee\u6539\u51b2\u7a81\u540e\uff0c\u518d\u63d0\u4ea4<\/em>\n$ git push origin dev\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"7-%E6%95%B4%E7%90%86%E5%88%86%E5%8F%89rebase\">7. \u6574\u7406\u5206\u53c9\uff08Rebase\uff09<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u611f\u89c9\u6ca1\u5565\u610f\u601d\uff0c\u62ef\u6551\u5f3a\u8feb\u75c7\uff1f\uff1f\uff1f<\/p><\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git rebase\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"%E5%85%AB%E6%A0%87%E7%AD%BE%E7%AE%A1%E7%90%86\">\u516b\u3001\u6807\u7b7e\u7ba1\u7406<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u7ed9\u67d0\u4e2acommit\u8d77\u4e2a\u6709\u610f\u4e49\u7684\u540d\u5b57\u7684\u6307\u9488\u5c31\u662ftag<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u5f53\u524d\u63d0\u4ea4\u6dfb\u52a0\u6807\u7b7e<\/em>\n$ git tag xxx\n\n<em># \u67e5\u770b\u5df2\u6709\u6807\u7b7e<\/em>\n$ git tag\n\n<em># \u7ed9\u6307\u5b9acommit \u6dfb\u52a0\u6807\u7b7e<\/em>\n$ git tag xxx commit_id\n\n<em># \u67e5\u770b\u67d0\u4e2atag\u7684commit\u7684\u5177\u4f53\u4fe1\u606f<\/em>\n$ git show &lt;tagname&gt;\n\n<em># \u63d0\u4ea4\u5e26\u8bf4\u660e\u7684tag<\/em>\n$ git tag -a &lt;tagname&gt; -m \"tag message\"\n\n<em># \u5220\u9664\u6307\u5b9a\u6807\u7b7e<\/em>\n$ git tag -d &lt;tagname&gt;\n\n<em># \u63a8\u9001\u67d0\u4e2a\u6807\u7b7e\u5230\u8fdc\u7a0b<\/em>\n$ git push origin &lt;tagname&gt;\n\n<em># \u63a8\u9001\u5168\u90e8\u6807\u7b7e\u5230\u8fdc\u7a0b<\/em>\n$ git push origin --tags\n\n<em># \u5220\u9664\u8fdc\u7a0b\u6807\u7b7e\u5206\u4e24\u90e8\uff081\uff1a\u5220\u9664\u672c\u5730\u6807\u7b7e\uff1b2\uff1a\u63a8\u9001\u72b6\u6001\u5230\u8fdc\u7a0b\uff09<\/em>\n$ git tag -d ex_tag\n$ git push origin :refs\/tags\/ex_tag\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"%E4%B9%9D%E4%BD%BF%E7%94%A8github%E6%88%96gitee%E7%9A%84%E4%B8%80%E8%88%AC%E6%B5%81%E7%A8%8B\">\u4e5d\u3001\u4f7f\u7528github\u6216gitee\u7684\u4e00\u822c\u6d41\u7a0b<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5148fork\u522b\u4eba\u7684repository\u5230\u81ea\u5df1\u8d26\u53f7\u4e0b\u9762\uff0c\u7136\u540eclone\u81ea\u5df1\u8d26\u53f7\u4e0b\u9762\u7684repository\u5230\u672c\u5730\uff0c\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image is-style-default\"><img decoding=\"async\" src=\"http:\/\/picbed.weboob.top\/blog\/20220706222429-2022-07-06-22-24-29.png\" alt=\"20220706222429-2022-07-06-22-24-29\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u4ee5\u540c\u65f6\u5173\u8054\u591a\u4e2a\u8fdc\u7a0b\u5e93\uff08\u901a\u8fc7\u522b\u540d\u533a\u5206\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u5173\u8054\u4e24\u4e2a\u5e93<\/em>\n$ git remote add github git@github.com:xxxx\/xxx.git\n$ git remote add gitee git@gitee.com:xxxx\/xxx.git\n\n<em># \u63a8\u9001github<\/em>\n$ git push github master\n\n<em># \u63a8\u9001gitee<\/em>\n$ git push gitee master\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6548\u679c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image is-style-default\"><img decoding=\"async\" src=\"http:\/\/picbed.weboob.top\/blog\/20220706223324-2022-07-06-22-33-24.png\" alt=\"20220706223324-2022-07-06-22-33-24\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"%E5%8D%81%E8%87%AA%E5%AE%9A%E4%B9%89git\">\u5341\u3001\u81ea\u5b9a\u4e49git<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-%E5%AE%9A%E4%B9%89%E5%BF%BD%E7%95%A5%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6%E7%9A%84%E6%96%87%E4%BB%B6\">1. \u5b9a\u4e49\u5ffd\u7565\u7248\u672c\u63a7\u5236\u7684\u6587\u4ef6<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u8fc7&nbsp;<code>.gitignore<\/code>&nbsp;\u6587\u4ef6\uff0c\u8bb0\u5f55\u9700\u8981\u653e\u624b\u7684\u6587\u4ef6\u3002<a href=\"https:\/\/github.com\/github\/gitignore\">\u5728\u7ebf\u7f16\u8f91<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5ffd\u7565\u6587\u4ef6\u7684\u539f\u5219\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u64cd\u4f5c\u7cfb\u7edf\u81ea\u52a8\u751f\u6210\u7684\u6587\u4ef6\uff08\u7f29\u7565\u56fe\uff09<\/li><li>\u7a0b\u5e8f\u7f16\u8bd1\u4e2d\u95f4\u6587\u4ef6\uff08.class\uff09\uff0c\u6216\u8005\u80fd\u901a\u8fc7\u7a0b\u5e8f\u8fd0\u884c\u81ea\u52a8\u751f\u6210\u7684\u6587\u4ef6<\/li><li>\u5ffd\u7565\u5e26\u6709\u654f\u611f\u4fe1\u606f\u7684\u6587\u4ef6\uff08\u5e26\u660e\u6587\u5bc6\u7801\u7684\u914d\u7f6e\u6587\u4ef6\uff09<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u5185\u5bb9\u8303\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u8fd9\u662f\u6ce8\u91ca\uff0c\u53ef\u4ee5\u5206\u7c7b\u6807\u8bb0;<\/em>\n<em># \u6587\u4ef6\u53ef\u4ee5\u76f4\u63a5\u5199\u5168\u79f0\uff0c\u6807\u6ce8\u5355\u4e2a\u6587\u4ef6<\/em>\nThumbs.db\nDesktop.ini\n\n<em># \u4e5f\u53ef\u4ee5\u4f7f\u7528\u901a\u914d\u7b26\u6807\u6ce8\u4e00\u7c7b\u6587\u4ef6<\/em>\n*.class\n<em># \u6392\u9664 `.` \u5f00\u5934\u7684\u6587\u4ef6<\/em>\n.*\n\n<em># \u4e5f\u53ef\u4ee5\u76f4\u63a5\u5ffd\u7565\u6587\u4ef6\u5939<\/em>\ndist\nbuild\n\n<em># \u89c4\u5219\u4f8b\u5916\u7684\u5355\u72ec\u6587\u4ef6<\/em>\n!.gitignore\n\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u81ea\u5df1\u7f16\u5199\u7684<code>.gitignore<\/code>\u6587\u4ef6\u6709\u95ee\u9898\uff0c\u53ef\u4ee5\u5f3a\u5236\u66f4\u65b0\u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git add -f filename\n\n<em># \u68c0\u67e5\u914d\u7f6e\u6587\u4ef6\u9519\u8bef<\/em>\n$ git check-ignore -v filename\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2-git%E7%9A%84%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE\">2. git\u7684\u5176\u4ed6\u914d\u7f6e<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>&#8211;global \u53c2\u6570\u5bf9\u5f53\u524d\u7528\u6237\u6240\u6709\u4ed3\u5e93\u90fd\u8d77\u4f5c\u7528<br \/>\u6bcf\u4e2arepository\u7684\u914d\u7f6e\u6587\u4ef6\u5728\uff1a<code>.git\/config<\/code><br \/>Git\u7684\u914d\u7f6e\u6587\u4ef6\u5728\uff1a<code>~\/.gitconfig<\/code><\/p><\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u5f00\u542f\u989c\u8272\u914d\u7f6e<\/em>\n$ git config --global color.ui true\n\n<em># \u914d\u7f6e\u547d\u4ee4\u522b\u540d(status --&gt; st)<\/em>\n$ git config --global alias.st status\n\n<em># \u914d\u7f6e\u547d\u4ee4\u522b\u540d(\u6253\u5370\u597d\u770b\u7684\u56fe\u5f62\u5316log)<\/em>\n$ git config --global alias.lg \"log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)&lt;%an&gt;%Creset' --abbrev-commit\"\n\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-%E6%90%AD%E5%BB%BA%E8%87%AA%E5%B7%B1%E7%9A%84git%E6%9C%8D%E5%8A%A1%E5%99%A8\">3. \u642d\u5efa\u81ea\u5df1\u7684Git\u670d\u52a1\u5668<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>system\uff1aDebian\/Ubuntu\/Deepin<\/p><\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code><em># 1. \u5b89\u88c5git<\/em>\n$ sudo apt install git\n\n<em># 2. \u521b\u5efa\u7528\u6237<\/em>\n<em># \u7981\u6b62\u767b\u9646shell<\/em>\n$ sudo adduser git\n$ sudo vim \/etc\/passwd\n<em># git:x:1001:1001:,,,:\/home\/git:\/bin\/bash --&gt; git:x:1001:1001:,,,:\/home\/git:\/usr\/bin\/git-shell<\/em>\n\n<em># 3. \u8bbe\u7f6e\u767b\u5f55\u8bc1\u4e66(\u6bcf\u884c\u4e00\u4e2a)<\/em>\n$ sudo vim ~\/git\/.ssh\/autorized_keys\n<em># adfeiaidfoeasdfefoadfeoasdjfe...<\/em>\n<em># adifekdikfjeaooisidfjeojfasda...<\/em>\n\n<em># 4. \u521d\u59cb\u5316 Repository\uff0c\u5e76\u66f4\u6539\u7528\u6237<\/em>\n$ cd \/srv\n$ sudo git init --bare sample.git\n$ sudo chown -R git:git sample.git\n\n<em># 5. clone \u8fdc\u7a0b\u4ed3\u5e93\u5230\u672c\u5730<\/em>\n$ git clone git@server:\/srv\/sample.git\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u6279\u91cf\u516c\u94a5\u7ba1\u7406\uff1a<a href=\"https:\/\/github.com\/res0nat0r\/gitosis\">Gitosis<\/a>&nbsp;\u7ec6\u7c92\u5ea6\u6743\u9650\u7ba1\u7406\uff1a<a href=\"https:\/\/github.com\/sitaramc\/gitolite\">Gitolite<\/a><\/p><\/blockquote>\n\n\n\n<ol class=\"wp-block-list\"><li><a href=\"https:\/\/blog.csdn.net\/CDL_LuFei\/article\/details\/123684728\">\u53c2\u8003\u6587\u732e1-\u56fe\u7247\u89e3\u6790git\u5de5\u4f5c\u539f\u7406<\/a><\/li><li><a href=\"https:\/\/www.liaoxuefeng.com\/wiki\/896043488029600\">\u53c2\u8003\u6587\u732e2-\u5ed6\u96ea\u5cf0\u5173\u4e8egit\u7684\u6587\u7ae0<\/a><\/li><\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001Git\u662f\u4ec0\u4e48 Git\u662f\u4e00\u4e2a\u514d\u8d39\u5f00\u6e90\u7684\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u6709Linux Torvaldds\u4e3a\u5e2e\u52a9\u7ba1\u7406Linu [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,5],"tags":[21],"class_list":["post-160","post","type-post","status-publish","format-standard","hentry","category-git","category-code_article","tag-git"],"_links":{"self":[{"href":"http:\/\/blog.weboob.top\/index.php?rest_route=\/wp\/v2\/posts\/160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.weboob.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.weboob.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.weboob.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.weboob.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=160"}],"version-history":[{"count":0,"href":"http:\/\/blog.weboob.top\/index.php?rest_route=\/wp\/v2\/posts\/160\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.weboob.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.weboob.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=160"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.weboob.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}