{"id":37546,"date":"2023-03-02T08:05:55","date_gmt":"2023-12-27T01:37:46","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/git%e9%80%9f%e6%9f%a5%e8%a1%a8-5\/"},"modified":"2024-04-29T17:02:08","modified_gmt":"2024-04-29T09:02:08","slug":"git%e9%80%9f%e6%9f%a5%e8%a1%a8-5","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/git%e9%80%9f%e6%9f%a5%e8%a1%a8-5\/","title":{"rendered":"Git\u901f\u67e5\u8868"},"content":{"rendered":"<h3>\u76ee\u524d\u7684\u5206\u652f\u663e\u793a<\/h3>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u81ea\u5206\u81ea\u8eab\u304c\u3044\u308b\u30d6\u30e9\u30f3\u30c1\u3092\u8868\u793a<\/ul>\n<\/li>\n<\/ul>\n<p>git branch<br \/>\n*(\u30a2\u30b9\u30bf\u30ea\u30b9\u30af)\u304c\u81ea\u5206\u81ea\u8eab\u304c\u3044\u308b\u30d6\u30e9\u30f3\u30c1<\/p>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git branch\r\n* master\r\n<\/code><\/pre>\n<h3>\u521b\u5efa\u5206\u652f<\/h3>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u666e\u901a\u306b\u30d6\u30e9\u30f3\u30c1\u4f5c\u6210<\/ul>\n<\/li>\n<\/ul>\n<p>git branch [\u4f5c\u6210\u3059\u308b\u30d6\u30e9\u30f3\u30c1\u540d]<\/p>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git branch test-branch1\r\n[root@Ogiman ogiman_repo]# git branch\r\n* master\r\n  test-branch1\u3000\u2605\u4f5c\u6210\u3055\u308c\u305f\u30d6\u30e9\u30f3\u30c1\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30d6\u30e9\u30f3\u30c1\u4f5c\u6210\u3057\u3066\u305d\u306e\u307e\u307e\u4f5c\u6210\u3057\u305f\u30d6\u30e9\u30f3\u30c1\u3078\u79fb\u52d5<\/ul>\n<\/li>\n<\/ul>\n<p>git checkout -b [\u4f5c\u6210\u3059\u308b\u30d6\u30e9\u30f3\u30c1\u540d]<br \/>\n\u81ea\u5206\u81ea\u8eab\u304c\u3044\u308b\u30d6\u30e9\u30f3\u30c1\u304b\u3089\u65b0\u898f\u3067\u30d6\u30e9\u30f3\u30c1\u304c\u4f5c\u6210\u3055\u308c\u308b<\/p>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git checkout -b test-branch2\r\nSwitched to a new branch 'test-branch2'\r\n[root@Ogiman ogiman_repo]# git branch\r\n  master\r\n  test-branch1\r\n* test-branch2\u3000\u2605\u4f5c\u6210\u3057\u3066\u79fb\u52d5\u3057\u305f\u30d6\u30e9\u30f3\u30c1\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u6307\u5b9a\u3057\u305f\u65e2\u5b58\u30d6\u30e9\u30f3\u30c1\u304b\u3089\u30d6\u30e9\u30f3\u30c1\u3092\u4f5c\u6210\u3057\u3066\u305d\u306e\u307e\u307e\u4f5c\u6210\u3057\u305f\u30d6\u30e9\u30f3\u30c1\u3078\u79fb\u52d5<\/ul>\n<\/li>\n<\/ul>\n<p>git checkout -b [\u4f5c\u6210\u3059\u308b\u30d6\u30e9\u30f3\u30c1\u540d] [\u6307\u5b9a\u3057\u305f\u65e2\u5b58\u30d6\u30e9\u30f3\u30c1]<\/p>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git checkout -b test-branch3 test-branch2\r\nSwitched to a new branch 'test-branch3'\r\n[root@Ogiman ogiman_repo]# git branch\r\n  master\r\n  test-branch1\r\n  test-branch2\r\n* test-branch3\u3000\u2605\u4f5c\u6210\u3057\u3066\u79fb\u52d5\u3057\u305f\u30d6\u30e9\u30f3\u30c1\r\n<\/code><\/pre>\n<h3>\u4fee\u6539\u5206\u652f\u540d\u79f0<\/h3>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30d6\u30e9\u30f3\u30c1\u540d\u3092\u5909\u3048\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>git branch -M [\u5909\u66f4\u524d\u306e\u30d6\u30e9\u30f3\u30c1] [\u5909\u66f4\u5f8c\u306e\u30d6\u30e9\u30f3\u30c1]<\/p>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git branch -M test-branch3 test-branch4\r\n[root@Ogiman ogiman_repo]# git branch\r\n  master\r\n  test-branch1\r\n  test-branch2\r\n* test-branch4\u3000\u2605test-branch3\u304b\u3089test-branch4\u306b\u5909\u66f4\u3055\u308c\u305f\r\n<\/code><\/pre>\n<h3>\u5206\u652f\u79fb\u52a8<\/h3>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30d6\u30e9\u30f3\u30c1\u3092\u7570\u52d5<\/ul>\n<\/li>\n<\/ul>\n<p>git checkout [\u79fb\u52d5\u3057\u305f\u3044\u30d6\u30e9\u30f3\u30c1]<\/p>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git branch\r\n  master\r\n  test-branch1\r\n  test-branch2\r\n* test-branch4\r\n[root@Ogiman ogiman_repo]# git checkout test-branch2\r\nSwitched to branch 'test-branch2'\r\n[root@Ogiman ogiman_repo]# git branch\r\n  master\r\n  test-branch1\r\n* test-branch2\u3000\u2605test-branch4\u304b\u3089test-branch2\u3078\u79fb\u52d5\r\n  test-branch4\r\n<\/code><\/pre>\n<h3>\u5220\u9664\u5206\u652f<\/h3>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u6307\u5b9a\u3057\u305f\u30d6\u30e9\u30f3\u30c1\u3092\u524a\u9664<\/ul>\n<\/li>\n<\/ul>\n<p>git branch -D [\u6307\u5b9a\u3057\u305f\u30d6\u30e9\u30f3\u30c1]<\/p>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git branch\r\n  master\r\n  test-branch1\r\n* test-branch2\r\n  test-branch4 \u2605\u3053\u306e\u30d6\u30e9\u30f3\u30c1\u3092\u524a\u9664\u3059\u308b\r\n[root@Ogiman ogiman_repo]# git branch -D test-branch4\r\nDeleted branch test-branch4 (was 68d346e).\r\n[root@Ogiman ogiman_repo]# git branch\r\n  master\r\n  test-branch1\r\n* test-branch2\r\n<\/code><\/pre>\n<h3>\u663e\u793a(\u5de5\u4f5c\u76ee\u5f55)\u66f4\u6539\u6587\u4ef6<\/h3>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30ef\u30fc\u30af\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u306e\u5909\u66f4\u30d5\u30a1\u30a4\u30eb\u3092\u8868\u793a<\/ul>\n<\/li>\n<\/ul>\n<p>git status<\/p>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git status\r\n# On branch test-branch2\r\n# Changes not staged for commit:\r\n#   (use \"git add &lt;file&gt;...\" to update what will be committed)\r\n#   (use \"git checkout -- &lt;file&gt;...\" to discard changes in working directory)\r\n#\r\n#       modified:   test\r\n#\r\nno changes added to commit (use \"git add\" and\/or \"git commit -a\")\r\n<\/code><\/pre>\n<h3>\u5728\u4e2d\u56fd\uff0c\u5c06\u4ee5\u4e0b\u5185\u5bb9\u7528\u4e2d\u6587\u8f6c\u6362\u4e3a\u540c\u4e49\u53e5\uff1a(\u66f4\u6539\u5de5\u4f5c\u76ee\u5f55)\u663e\u793a\u6587\u4ef6\u5dee\u5f02\u3002<\/h3>\n<ul class=\"post-ul\">git diff [\u5909\u66f4\u30d5\u30a1\u30a4\u30eb]<\/ul>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git diff\r\ndiff --git a\/test b\/test\r\nindex a5bce3f..9daeafb 100644\r\n--- a\/test\r\n+++ b\/test\r\n@@ -1 +1 @@\r\n-test1\r\n+test\r\n\r\n[root@Ogiman ogiman_repo]# git diff test\r\ndiff --git a\/test b\/test\r\nindex a5bce3f..9daeafb 100644\r\n--- a\/test\r\n+++ b\/test\r\n@@ -1 +1 @@\r\n-test1\r\n+test\r\n<\/code><\/pre>\n<h3>\u66f4\u6539\u5de5\u4f5c\u76ee\u5f55\u65f6\u5220\u9664\u6587\u4ef6.<\/h3>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u3092\u524a\u9664<\/ul>\n<\/li>\n<\/ul>\n<p>git checkout [\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb]<\/p>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git status\r\n# On branch test-branch2\r\n# Changes not staged for commit:\r\n#   (use \"git add &lt;file&gt;...\" to update what will be committed)\r\n#   (use \"git checkout -- &lt;file&gt;...\" to discard changes in working directory)\r\n#\r\n#       modified:   test\r\n#\r\nno changes added to commit (use \"git add\" and\/or \"git commit -a\")\r\n[root@Ogiman ogiman_repo]# git checkout test\r\n[root@Ogiman ogiman_repo]# git status\r\n# On branch test-branch2\r\nnothing to commit, working directory clean\r\n<\/code><\/pre>\n<h3>\u66f4\u6539\u6587\u4ef6\u6dfb\u52a0\u5230\u5de5\u4f5c\u76ee\u5f55\u7684\u9636\u6bb5\u4e2d<\/h3>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30b9\u30c6\u30fc\u30b8\u306b\u8ffd\u52a0<\/ul>\n<\/li>\n<\/ul>\n<p>git add [\u5909\u66f4\u30d5\u30a1\u30a4\u30eb]<\/p>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git status\r\n# On branch test-branch2\r\n# Changes not staged for commit: \u2605\u30ef\u30fc\u30af\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u3042\u308b\u3053\u3068\u3092\u793a\u3059\r\n#   (use \"git add &lt;file&gt;...\" to update what will be committed)\r\n#   (use \"git checkout -- &lt;file&gt;...\" to discard changes in working directory)\r\n#\r\n#       modified:   test\r\n#\r\nno changes added to commit (use \"git add\" and\/or \"git commit -a\")\r\n[root@Ogiman ogiman_repo]# git add test\r\n<\/code><\/pre>\n<h3>\u663e\u793a(\u821e\u53f0)\u53d8\u66f4\u6587\u4ef6<\/h3>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30b9\u30c6\u30fc\u30b8\u306e\u5909\u66f4\u30d5\u30a1\u30a4\u30eb\u3092\u8868\u793a<\/ul>\n<\/li>\n<\/ul>\n<p>git status<br \/>\n\u30ef\u30fc\u30af\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u306e\u5909\u66f4\u30d5\u30a1\u30a4\u30eb\u3092\u8868\u793a\u3068\u540c\u69d8<\/p>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git status\r\n# On branch test-branch2\r\n# Changes to be committed:\u3000\u2605\u30b9\u30c6\u30fc\u30b8\u3067\u3042\u308b\u3053\u3068\u3092\u793a\u3059\r\n#   (use \"git reset HEAD &lt;file&gt;...\" to unstage)\r\n#\r\n#       modified:   test\r\n#\r\n<\/code><\/pre>\n<h3>\u5220\u9664\uff08\u821e\u53f0\uff09\u53d8\u66f4\u6587\u4ef6<\/h3>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u30b9\u30c6\u30fc\u30b8\u304b\u3089\u30ef\u30fc\u30af\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u306b\u623b\u3059<\/ul>\n<\/li>\n<\/ul>\n<p>git reset HEAD [\u623b\u3059\u30d5\u30a1\u30a4\u30eb]<\/p>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git status\r\n# On branch test-branch2\r\n# Changes to be committed: \u2605\u30b9\u30c6\u30fc\u30b8\u3067\u3042\u308b\u3053\u3068\u3092\u793a\u3059\r\n#   (use \"git reset HEAD &lt;file&gt;...\" to unstage)\r\n#\r\n#       modified:   test\r\n#\r\n[root@Ogiman ogiman_repo]# git reset HEAD test\r\nUnstaged changes after reset:\r\nM       test\r\n[root@Ogiman ogiman_repo]# git status\r\n# On branch test-branch2\r\n# Changes not staged for commit:\u3000\u2605\u30ef\u30fc\u30af\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u306b\u623b\u3063\u305f\u3053\u3068\u3092\u793a\u3059\r\n#   (use \"git add &lt;file&gt;...\" to update what will be committed)\r\n#   (use \"git checkout -- &lt;file&gt;...\" to discard changes in working directory)\r\n#\r\n#       modified:   test\r\n#\r\nno changes added to commit (use \"git add\" and\/or \"git commit -a\")\r\n<\/code><\/pre>\n<h3>\u63d0\u4ea4<\/h3>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">commit \u3059\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>git commit -m &#8220;\u30b3\u30e1\u30f3\u30c8&#8221;<br \/>\ngit commit -m &#8220;\u30b3\u30e1\u30f3\u30c8&#8221;\u3000\u5909\u66f4\u30d5\u30a1\u30a4\u30eb<\/p>\n<p>\u3053\u308c\u3067\u30d5\u30a1\u30a4\u30eb\u5358\u4f4d\u3067\u30b3\u30df\u30c3\u30c8\u53ef\u80fd<\/p>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git status\r\n# On branch test-branch2\r\n# Changes to be committed:\r\n#   (use \"git reset HEAD &lt;file&gt;...\" to unstage)\r\n#\r\n#       modified:   test\r\n#\r\n[root@Ogiman ogiman_repo]# git commit -m \"add test v1\"\r\n[test-branch2 a1153eb] add test v1\r\n 1 file changed, 1 insertion(+), 1 deletion(-)\r\n<\/code><\/pre>\n<h3>\u6dfb\u52a0\u66f4\u6539\u6587\u4ef6\u5230\u821e\u53f0\uff08stage\uff09\u4e2d\u7684\u8d44\u6599\u5e93\uff08repository\uff09\u3002<\/h3>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">push\u3059\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>git push origin [\u5909\u66f4\u30d5\u30a1\u30a4\u30eb\u3092\u542b\u3080\u30d6\u30e9\u30f3\u30c1]<\/p>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git push origin test-branch2\r\nUsername for 'https:\/\/github.com': ogiman0216\r\nPassword for 'https:\/\/ogiman0216@github.com':\r\nCounting objects: 5, done.\r\nCompressing objects: 100% (2\/2), done.\r\nWriting objects: 100% (3\/3), 298 bytes | 0 bytes\/s, done.\r\nTotal 3 (delta 0), reused 0 (delta 0)\r\nTo https:\/\/github.com\/ogiman0216\/ogiman_repo.git\r\n   a1153eb..dd11ba3  test-branch2 -&gt; test-branch2\r\n[root@Ogiman ogiman_repo]#\r\n<\/code><\/pre>\n<h3>\u5220\u9664(\u5b58\u50a8\u5e93)\u7684\u66f4\u6539\u6587\u4ef6<\/h3>\n<ul class=\"post-ul\">\u56f0\u3063\u305f\u3068\u304d\u306eGit<\/ul>\n<h3>\u4ece\u8fdc\u7a0b\u5206\u652f\u83b7\u53d6\u6700\u65b0\u4fe1\u606f\u5e76\u66f4\u65b0\u672c\u5730\u5206\u652f\u3002<\/h3>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">git pull<\/ul>\n<\/li>\n<\/ul>\n<p>\u3053\u308c\u306fgit fetch + git merge \u3092\u7d44\u307f\u3042\u308f\u305b<\/p>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git pull\r\nMerge made by the 'recursive' strategy.\r\n test | 2 +-\r\n 1 file changed, 1 insertion(+), 1 deletion(-)\r\n<\/code><\/pre>\n<h3>\u4ece\u8fdc\u7a0b\u5206\u652f\u83b7\u53d6\u6700\u65b0\u4fe1\u606f\u5e76\u66f4\u65b0\u8ddf\u8e2a\u7684\u8fdc\u7a0b\u5206\u652f\u3002<\/h3>\n<ul class=\"post-ul\">git fetch<\/ul>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git fetch\r\n<\/code><\/pre>\n<h3>\u6587\u672c\u641c\u7d22<\/h3>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">git grep [\u691c\u7d22\u6587\u5b57\u5217]<\/ul>\n<\/li>\n<\/ul>\n<p>\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089\u6587\u5b57\u5217\u3092\u691c\u7d22\u3059\u308b<\/p>\n<h2>\u65e5\u5fd7\u76f8\u5173<\/h2>\n<h3>\u663e\u793a\u65e5\u5fd7<\/h3>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">git log<\/ul>\n<\/li>\n<\/ul>\n<p>view\u3067\u958b\u304b\u308c\u308b<\/p>\n<pre class=\"post-pre\"><code>commit 95ce2dfcc0eb22e2954b5cb0adeef00383af20d0\r\nAuthor: ogiman0216 &lt;ogiman@hotmail.com&gt;\r\nDate:   Mon Feb 19 23:40:05 2018 +0900\r\n\r\n    Revert \"add test v1\"\r\n\r\n    This reverts commit dd11ba3ee634054f0c53557b52cfd3c9fd9ca017.\r\n\r\ncommit dd11ba3ee634054f0c53557b52cfd3c9fd9ca017\r\nAuthor: ogiman0216 &lt;ogiman@hotmail.com&gt;\r\nDate:   Mon Feb 19 23:38:15 2018 +0900\r\n\r\n    add test v1\r\n\r\ncommit a1153eb35ca5c41aef230985e7aa7922c361738f\r\nAuthor: ogiman0216 &lt;ogiman@hotmail.com&gt;\r\nDate:   Mon Feb 19 23:32:47 2018 +0900\r\n\u7701\u7565\r\n<\/code><\/pre>\n<h3>\u663e\u793a\u7279\u5b9a\u884c\u7684\u65e5\u5fd7\u3002<\/h3>\n<ul class=\"post-ul\">git log -1<\/ul>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git log -1\r\ncommit 95ce2dfcc0eb22e2954b5cb0adeef00383af20d0\r\nAuthor: ogiman0216 &lt;ogiman@hotmail.com&gt;\r\nDate:   Mon Feb 19 23:40:05 2018 +0900\r\n\r\n    Revert \"add test v1\"\r\n\r\n    This reverts commit dd11ba3ee634054f0c53557b52cfd3c9fd9ca017.\r\n[root@Ogiman ogiman_repo]# git log -2\r\ncommit 95ce2dfcc0eb22e2954b5cb0adeef00383af20d0\r\nAuthor: ogiman0216 &lt;ogiman@hotmail.com&gt;\r\nDate:   Mon Feb 19 23:40:05 2018 +0900\r\n\r\n    Revert \"add test v1\"\r\n\r\n    This reverts commit dd11ba3ee634054f0c53557b52cfd3c9fd9ca017.\r\n\r\ncommit dd11ba3ee634054f0c53557b52cfd3c9fd9ca017\r\nAuthor: ogiman0216 &lt;ogiman@hotmail.com&gt;\r\nDate:   Mon Feb 19 23:38:15 2018 +0900\r\n\r\n    add test v1\r\n<\/code><\/pre>\n<h3>\u663e\u793a\u4e00\u4e2a\u884c\u7684\u65e5\u5fd7<\/h3>\n<ul class=\"post-ul\">git log &#8211;oneline<\/ul>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git log --oneline\r\n95ce2df Revert \"add test v1\"\r\ndd11ba3 add test v1\r\na1153eb add test v1\r\n68d346e Merge branch 'master' of https:\/\/github.com\/ogiman0216\/ogiman_repo\r\nf4c9a2c Revert \"third commit (#5)\"\r\n14b803b third commit (#5)\r\n05da546 23\r\nb461e72 Merge pull request #4 from ogiman0216\/test-branch1\r\n8cbbd0b second commit\r\n398449c Create README.md\r\n27cad8b first commit\r\ne41886c delete\r\ne993788 Merge pull request #2 from ogiman0216\/mituru\r\n544234b conflict\r\n955baa0 Merge pull request #3 from ogiman0216\/hoge\r\n93f41a1 forth commit\r\n270ab24 third commit\r\n6e3bdbf Merge pull request #1 from ogiman0216\/ogiman\r\ncdfe2c3 first commit\r\n4647b26 first commit\r\n<\/code><\/pre>\n<h3>\u663e\u793a\u6307\u5b9a\u65f6\u95f4\u6bb5\u7684\u65e5\u5fd7<\/h3>\n<ul class=\"post-ul\">git log &#8211;oneline &#8211;after=[\u958b\u59cb\u306e\u8868\u793a] &#8211;before=[\u7d42\u4e86\u306e\u8868\u793a]<\/ul>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git log --oneline --after=2017\/08\/01 --before=2018\/02\/19\r\n95ce2df Revert \"add test v1\"\r\ndd11ba3 add test v1\r\na1153eb add test v1\r\n68d346e Merge branch 'master' of https:\/\/github.com\/ogiman0216\/ogiman_repo\r\nf4c9a2c Revert \"third commit (#5)\"\r\n14b803b third commit (#5)\r\n05da546 23\r\nb461e72 Merge pull request #4 from ogiman0216\/test-branch1\r\n8cbbd0b second commit\r\n398449c Create README.md\r\n27cad8b first commit\r\ne41886c delete\r\n<\/code><\/pre>\n<h3>\u663e\u793a\u6307\u5b9a\u63d0\u4ea4\u8005\u7684\u65e5\u5fd7<\/h3>\n<ul class=\"post-ul\">git log &#8211;oneline &#8211;committer=[\u30b3\u30df\u30c3\u30c8\u3057\u305f\u30a2\u30ab\u30a6\u30f3\u30c8]<\/ul>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git log --oneline --committer=ogiman0216\r\n95ce2df Revert \"add test v1\"\r\ndd11ba3 add test v1\r\na1153eb add test v1\r\n68d346e Merge branch 'master' of https:\/\/github.com\/ogiman0216\/ogiman_repo\r\nf4c9a2c Revert \"third commit (#5)\"\r\n05da546 23\r\n8cbbd0b second commit\r\n27cad8b first commit\r\ne41886c delete\r\n544234b conflict\r\n93f41a1 forth commit\r\n270ab24 third commit\r\ncdfe2c3 first commit\r\n4647b26 first commit\r\n<\/code><\/pre>\n<h3>\u67e5\u770b\u7279\u5b9a\u63d0\u4ea4\u7684\u5185\u5bb9<\/h3>\n<ul class=\"post-ul\">git show [commit-hash]<\/ul>\n<pre class=\"post-pre\"><code>[root@Ogiman ogiman_repo]# git show cecca4f6\r\n******\r\n<\/code><\/pre>\n<h3>\u641c\u7d22\u63d0\u4ea4\u65e5\u5fd7<\/h3>\n<ul class=\"post-ul\">git log &#8211;grep [\u691c\u7d22\u6587\u5b57\u5217]<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u524d\u7684\u5206\u652f\u663e\u793a \u81ea\u5206\u81ea\u8eab\u304c\u3044\u308b\u30d6\u30e9\u30f3\u30c1\u3092\u8868\u793a git branch *(\u30a2\u30b9\u30bf\u30ea\u30b9\u30af)\u304c\u81ea\u5206\u81ea\u8eab\u304c\u3044\u308b\u30d6\u30e9\u30f3\u30c1 [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-37546","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>Git\u901f\u67e5\u8868 - 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\/git\u901f\u67e5\u8868-5\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git\u901f\u67e5\u8868\" \/>\n<meta property=\"og:description\" content=\"\u76ee\u524d\u7684\u5206\u652f\u663e\u793a \u81ea\u5206\u81ea\u8eab\u304c\u3044\u308b\u30d6\u30e9\u30f3\u30c1\u3092\u8868\u793a git branch *(\u30a2\u30b9\u30bf\u30ea\u30b9\u30af)\u304c\u81ea\u5206\u81ea\u8eab\u304c\u3044\u308b\u30d6\u30e9\u30f3\u30c1 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/git\u901f\u67e5\u8868-5\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-27T01:37:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-29T09:02:08+00:00\" \/>\n<meta name=\"author\" content=\"\u9038, \u79d1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u9038, \u79d1\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \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\/git%e9%80%9f%e6%9f%a5%e8%a1%a8-5\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/git%e9%80%9f%e6%9f%a5%e8%a1%a8-5\/\",\"name\":\"Git\u901f\u67e5\u8868 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-12-27T01:37:46+00:00\",\"dateModified\":\"2024-04-29T09:02:08+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/85c1dae56e6ea1e695c73d33c684d487\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/git%e9%80%9f%e6%9f%a5%e8%a1%a8-5\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/git%e9%80%9f%e6%9f%a5%e8%a1%a8-5\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/git%e9%80%9f%e6%9f%a5%e8%a1%a8-5\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Git\u901f\u67e5\u8868\"}]},{\"@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\/85c1dae56e6ea1e695c73d33c684d487\",\"name\":\"\u9038, \u79d1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g\",\"caption\":\"\u9038, \u79d1\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/keyi\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/git%e9%80%9f%e6%9f%a5%e8%a1%a8-5\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Git\u901f\u67e5\u8868 - 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\/git\u901f\u67e5\u8868-5\/","og_locale":"zh_CN","og_type":"article","og_title":"Git\u901f\u67e5\u8868","og_description":"\u76ee\u524d\u7684\u5206\u652f\u663e\u793a \u81ea\u5206\u81ea\u8eab\u304c\u3044\u308b\u30d6\u30e9\u30f3\u30c1\u3092\u8868\u793a git branch *(\u30a2\u30b9\u30bf\u30ea\u30b9\u30af)\u304c\u81ea\u5206\u81ea\u8eab\u304c\u3044\u308b\u30d6\u30e9\u30f3\u30c1 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/git\u901f\u67e5\u8868-5\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-12-27T01:37:46+00:00","article_modified_time":"2024-04-29T09:02:08+00:00","author":"\u9038, \u79d1","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u9038, \u79d1","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/git%e9%80%9f%e6%9f%a5%e8%a1%a8-5\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/git%e9%80%9f%e6%9f%a5%e8%a1%a8-5\/","name":"Git\u901f\u67e5\u8868 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-12-27T01:37:46+00:00","dateModified":"2024-04-29T09:02:08+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/85c1dae56e6ea1e695c73d33c684d487"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/git%e9%80%9f%e6%9f%a5%e8%a1%a8-5\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/git%e9%80%9f%e6%9f%a5%e8%a1%a8-5\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/git%e9%80%9f%e6%9f%a5%e8%a1%a8-5\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"Git\u901f\u67e5\u8868"}]},{"@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\/85c1dae56e6ea1e695c73d33c684d487","name":"\u9038, \u79d1","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g","caption":"\u9038, \u79d1"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/keyi\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/git%e9%80%9f%e6%9f%a5%e8%a1%a8-5\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37546","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\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=37546"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37546\/revisions"}],"predecessor-version":[{"id":86516,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37546\/revisions\/86516"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=37546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=37546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=37546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}