{"id":9380,"date":"2020-03-03T00:13:59","date_gmt":"2020-03-02T15:13:59","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=9380"},"modified":"2023-05-27T18:57:55","modified_gmt":"2023-05-27T09:57:55","slug":"%e3%80%90git%e3%80%91%e5%a4%89%e6%9b%b4%e5%b7%ae%e5%88%86%e3%82%92%e7%a2%ba%e8%aa%8d%e3%81%99%e3%82%8b%e3%80%82","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=9380","title":{"rendered":"\u3010Git\u3011\u5909\u66f4\u5dee\u5206(git diff)\u3001\u5909\u66f4\u5c65\u6b74(git log)\u3092\u78ba\u8a8d\u3059\u308b\u3002"},"content":{"rendered":"<h2>\u5909\u66f4\u5dee\u5206<\/h2>\n<h3>\u5404\u30a8\u30ea\u30a2\u306e\u5dee\u5206\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/h3>\n<h4>git add\u3059\u308b\u524d\u306e\u5dee\u5206\uff08\u30ef\u30fc\u30af\u30c4\u30ea\u30fc\u3068\u30b9\u30c6\u30fc\u30b8\u306e\u5dee\u5206\uff09<\/h4>\n<pre class=\"lang:default decode:true\">git diff<\/pre>\n<p>\u307e\u305f\u306f<\/p>\n<pre class=\"lang:default decode:true\">git diff &lt;\u30d5\u30a1\u30a4\u30eb\u540d&gt;<\/pre>\n<p><span style=\"color: #ff0000;\"><strong>\u30ef\u30fc\u30af\u30c4\u30ea\u30fc\u3068\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u30a8\u30ea\u30a2\u306e\u5dee\u5206<\/strong><\/span>\u3092\u51fa\u529b\u3057\u307e\u3059\u3002\uff08\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u30a8\u30ea\u30a2\u767b\u9332\u5f8c\u306b\u3069\u3093\u306a\u5909\u66f4\u304c\u884c\u308f\u308c\u3066\u3044\u308b\u304b\u304c\u308f\u304b\u308a\u307e\u3059\u3002\uff09<\/p>\n<h4>git add\u3057\u305f\u5f8c\u306e\u5dee\u5206\uff08\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u30a8\u30ea\u30a2\u3068\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u5dee\u5206\uff09<\/h4>\n<pre class=\"lang:default decode:true\">git diff --staged<\/pre>\n<p>\u307e\u305f\u306f<\/p>\n<pre class=\"lang:default decode:true\">git diff --cached<\/pre>\n<p><span style=\"color: #ff0000;\"><strong>\u3082\u3057\u4e00\u5ea6\u3082\u30b3\u30df\u30c3\u30c8\u3092\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u30a8\u30ea\u30a2\u306b\u767b\u9332\u3057\u305f\u5185\u5bb9\u3060\u3051\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/strong><\/span><\/p>\n<h3>\u30d6\u30e9\u30f3\u30c1\u540c\u58eb\u3092\u6bd4\u8f03\u3059\u308b\u3002<\/h3>\n<pre class=\"lang:default decode:true\">git diff \u6bd4\u8f03\u5148\u30d6\u30e9\u30f3\u30c1\u540d<\/pre>\n<p>\u73fe\u5728\u6240\u5c5e\u3057\u3066\u3044\u308b\u30d6\u30e9\u30f3\u30c1\u3068\u6bd4\u8f03\u5148\u306e\u30d6\u30e9\u30f3\u30c1\u3092\u5dee\u5206\u3092\u6bd4\u8f03\u3057\u307e\u3059\u3002<\/p>\n<h2>\u5909\u66f4\u5c65\u6b74<\/h2>\n<p>\u300cgit log\u300d\u3092\u4f7f\u3048\u3070\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u4e2d\u306b\u8a18\u9332\u3055\u308c\u3066\u3044\u308b\u30b3\u30df\u30c3\u30c8\u5c65\u6b74\uff08\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5909\u66f4\u5c65\u6b74\uff09\u3092\u8868\u793a\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u5185\u5bb9\u304c\u8a18\u9332\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u5909\u66f4\u3057\u305f\u5185\u5bb9<\/li>\n<li>\u5909\u66f4\u65e5\u6642<\/li>\n<li>\u5909\u66f4\u8005\u306e\u540d\u524d<\/li>\n<li>\u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8<\/li>\n<\/ul>\n<h3>\u57fa\u672c<\/h3>\n<pre class=\"lang:default decode:true\">git log<\/pre>\n<h3>\u7279\u5b9a\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5c65\u6b74\u3060\u3051\u78ba\u8a8d\u3059\u308b\u3002<\/h3>\n<pre class=\"lang:default decode:true\">git log \u30d5\u30a1\u30a4\u30eb\u540d<\/pre>\n<h3>\u4e00\u884c\u3067\u8868\u793a\u3059\u308b\u3002<\/h3>\n<p>\u300cgit log\u300d\u3060\u3051\u3067\u306f\u304b\u306a\u308a\u5927\u91cf\u306e\u30ed\u30b0\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u8981\u70b9\u3060\u3051\u8868\u793a\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">git log --oneline<\/pre>\n<h3>\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u5dee\u5206\u3092\u8868\u793a\u3059\u308b\u3002<\/h3>\n<p>\u7279\u5b9a\u30d5\u30a1\u30a4\u30eb\u3060\u3051\u5dee\u5206\u3092\u898b\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">git log -p &lt;\u30d5\u30a1\u30a4\u30eb\u540d&gt;<\/pre>\n<h3>\u8868\u793a\u3059\u308b\u30b3\u30df\u30c3\u30c8\u6570\u3092\u5236\u9650\u3059\u308b\u3002<\/h3>\n<p>\u6700\u8fd1\u306e\u5909\u66f4\u5c65\u6b74\u3060\u3051\u3067\u78ba\u8a8d\u3057\u305f\u3044\u5834\u5408\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">git log -n &lt;\u30b3\u30df\u30c3\u30c8\u6570&gt;<\/pre>\n<h3>\u7279\u5b9a\u306e\u4eba\u306e\u30b3\u30df\u30c3\u30c8\u5c65\u6b74\u3092\u78ba\u8a8d\u3059\u308b<\/h3>\n<pre class=\"lang:default decode:true \">git log -author &lt;\u540d\u524d&gt;<\/pre>\n<h3>\u30b0\u30e9\u30d5\u3067\u30b3\u30df\u30c3\u30c8\u5c65\u6b74\u3092\u8868\u793a\u3059\u308b<\/h3>\n<pre class=\"lang:default decode:true \">git log --graph<\/pre>\n<p>\u30d6\u30e9\u30f3\u30c1\u3084\u30de\u30fc\u30b8\u306e\u5c65\u6b74\u3092\u30a2\u30b9\u30ad\u30fc\u30b0\u30e9\u30d5\u3067\u8868\u793a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>\u7279\u5b9a\u306e\u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u542b\u3080\u7269\u3060\u3051\u3092\u62bd\u51fa\u3059\u308b\u3002<\/h3>\n<pre class=\"lang:default decode:true \">git log --grep='\u5185\u5bb9'<\/pre>\n<p>\u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u306b\u7279\u5b9a\u306e\u5024\u3092\u542b\u3080\u3082\u306e\u3060\u3051\u62bd\u51fa\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>\u5909\u66f4\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u8868\u793a\u3059\u308b\u3002<\/h3>\n<pre class=\"lang:default decode:true\">git log --name-status<\/pre>\n<h3>\u8ffd\u52a0\u884c\u6570\u3068\u524a\u9664\u884c\u6570\u3092\u305d\u308c\u305e\u308c\u8868\u793a\u3059\u308b\u3002<\/h3>\n<pre class=\"lang:default decode:true \">git log --numstat<\/pre>\n<h3>\u65e5\u6642\u3092\u6307\u5b9a\u3057\u3066\u8868\u793a\u3059\u308b\u3002<\/h3>\n<p>\u3061\u306a\u307f\u306b\u3001since\u3058\u3083\u306a\u304f\u3066\u3001\u300cuntil\u300d\u3092\u4f7f\u3048\u3070\u305d\u306e\u9006\u3092\u8868\u793a\u3067\u304d\u307e\u3059\u3002\uff08\u4ee5\u524d\uff09<\/p>\n<h4>2\u65e5\u524d\u4ee5\u964d\u306e\u3082\u306e\u3060\u3051\u8868\u793a\u3059\u308b\u3002<\/h4>\n<pre class=\"lang:default decode:true\">git log --since=\"2 days ago\"<\/pre>\n<h4>\u6642\u9593\u307e\u3067\u6307\u5b9a\u3059\u308b\u3002<\/h4>\n<pre class=\"lang:default decode:true\">git log --since=\"2023-05-03 00:30:00\"<\/pre>\n<h3>\u30b3\u30df\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u7d71\u8a08\u60c5\u5831\u3092\u8868\u793a\u3059\u308b\u3002<\/h3>\n<pre class=\"lang:default decode:true  \">git log --stat<\/pre>\n","protected":false},"excerpt":{"rendered":"\u5909\u66f4\u5dee\u5206 \u5404\u30a8\u30ea\u30a2\u306e\u5dee\u5206\u3092\u78ba\u8a8d\u3059\u308b\u3002 git add\u3059\u308b\u524d\u306e\u5dee\u5206\uff08\u30ef\u30fc\u30af\u30c4\u30ea\u30fc\u3068\u30b9\u30c6\u30fc\u30b8\u306e\u5dee\u5206\uff09 git diff \u307e\u305f\u306f git diff &lt;\u30d5\u30a1\u30a4\u30eb\u540d&gt; \u30ef\u30fc\u30af\u30c4\u30ea\u30fc\u3068\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u30a8\u30ea\u30a2\u306e\u5dee\u5206\u3092\u51fa\u529b\u3057\u307e\u3059 [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[32],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/9380"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9380"}],"version-history":[{"count":10,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/9380\/revisions"}],"predecessor-version":[{"id":20188,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/9380\/revisions\/20188"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9380"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}