{"id":610,"date":"2015-09-14T12:46:54","date_gmt":"2015-09-14T03:46:54","guid":{"rendered":"http:\/\/www.chihayafuru.jp\/tech\/?p=610"},"modified":"2022-10-07T23:19:04","modified_gmt":"2022-10-07T14:19:04","slug":"git-diff-%e3%81%ae%e3%81%a4%e3%81%8b%e3%81%84%e3%81%8b%e3%81%9f","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/610","title":{"rendered":"[git] diff \u306e\u3064\u304b\u3044\u304b\u305f"},"content":{"rendered":"<h2>Working \u3068 Index \u306e\u5dee\u5206<\/h2>\n<pre class=\"lang:default decode:true \" >$ git diff<\/pre>\n<p><a href=\"http:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/610\/git_diff\" rel=\"attachment wp-att-1990\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.chihayafuru.jp\/tech\/wp-content\/uploads\/2015\/09\/git_diff-300x177.png\" alt=\"\" width=\"300\" height=\"177\" class=\"alignnone size-medium wp-image-1990\" srcset=\"https:\/\/www.chihayafuru.jp\/tech\/wp-content\/uploads\/2015\/09\/git_diff-300x177.png 300w, https:\/\/www.chihayafuru.jp\/tech\/wp-content\/uploads\/2015\/09\/git_diff-624x368.png 624w, https:\/\/www.chihayafuru.jp\/tech\/wp-content\/uploads\/2015\/09\/git_diff.png 730w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><!--more--><\/p>\n<p>&nbsp; <\/p>\n<h2>Working \u3068 Local repository(\u306eHEAD)\u306e\u5dee\u5206<\/h2>\n<pre class=\"lang:default decode:true \" >$ git diff HEAD<\/pre>\n<p><a href=\"http:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/610\/git_diff_head\" rel=\"attachment wp-att-1992\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.chihayafuru.jp\/tech\/wp-content\/uploads\/2015\/09\/git_diff_head-300x177.png\" alt=\"\" width=\"300\" height=\"177\" class=\"alignnone size-medium wp-image-1992\" srcset=\"https:\/\/www.chihayafuru.jp\/tech\/wp-content\/uploads\/2015\/09\/git_diff_head-300x177.png 300w, https:\/\/www.chihayafuru.jp\/tech\/wp-content\/uploads\/2015\/09\/git_diff_head-624x368.png 624w, https:\/\/www.chihayafuru.jp\/tech\/wp-content\/uploads\/2015\/09\/git_diff_head.png 730w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h2>Index \u3068 Local repository(\u306eHEAD)\u306e\u5dee\u5206<\/h2>\n<pre class=\"lang:default decode:true \" >$ git diff --cached<\/pre>\n<pre class=\"lang:default decode:true \" >$ git diff --staged<\/pre>\n<p><a href=\"http:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/610\/git_diff_cached\" rel=\"attachment wp-att-1993\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.chihayafuru.jp\/tech\/wp-content\/uploads\/2015\/09\/git_diff_cached-300x177.png\" alt=\"\" width=\"300\" height=\"177\" class=\"alignnone size-medium wp-image-1993\" srcset=\"https:\/\/www.chihayafuru.jp\/tech\/wp-content\/uploads\/2015\/09\/git_diff_cached-300x177.png 300w, https:\/\/www.chihayafuru.jp\/tech\/wp-content\/uploads\/2015\/09\/git_diff_cached-624x368.png 624w, https:\/\/www.chihayafuru.jp\/tech\/wp-content\/uploads\/2015\/09\/git_diff_cached.png 730w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<hr>\n<p>&nbsp;<\/p>\n<h2>\u5dee\u5206\u304c\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u540d\u3060\u3051\u3092\u8868\u793a<\/h2>\n<p><code>--name-only<\/code><\/p>\n<h3>\u4f8b<\/h3>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git diff HEAD^ --name-only<\/pre>\n<p>&nbsp;<\/p>\n<hr>\n<p>&nbsp;<\/p>\n<h2>\u30d6\u30e9\u30f3\u30c1\u9593\u306e\u5dee\u5206<\/h2>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git diff [\u30d6\u30e9\u30f3\u30c1\u540dA] [\u30d6\u30e9\u30f3\u30c1\u540dB]<\/pre>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git diff [\u30d6\u30e9\u30f3\u30c1\u540dA]..[\u30d6\u30e9\u30f3\u30c1\u540dB]<\/pre>\n<p>\u30d6\u30e9\u30f3\u30c1\u306e\u6700\u65b0\u30b3\u30df\u30c3\u30c8\u540c\u58eb\u306e\u6bd4\u8f03\u3002<\/p>\n<h3>\u4f8b<\/h3>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git diff master develop<\/pre>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git diff master..develop<\/pre>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git diff master develop main.c<\/pre>\n<p>&nbsp;<\/p>\n<h2>\u30de\u30fc\u30b8\u30d9\u30fc\u30b9\u306e\u5dee\u5206<\/h2>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git diff [\u30d6\u30e9\u30f3\u30c1\u540dA]...[\u30d6\u30e9\u30f3\u30c1\u540dB]<\/pre>\n<p>\uff12\u3064\u306e\u30d6\u30e9\u30f3\u30c1\u306e\u30de\u30fc\u30b8\u30d9\u30fc\u30b9\u304b\u3089\u306e\u5dee\u5206<\/p>\n<h3>\u4f8b<\/h3>\n<pre class=\"lang:default highlight:0 decode:true \" >$ git diff master...develop<\/pre>\n<p>&nbsp;<\/p>\n<hr>\n<p>&nbsp;<\/p>\n<h2>\u6bd4\u8f03\u30aa\u30d7\u30b7\u30e7\u30f3<\/h2>\n<dl>\n<dt><code>-w<\/code>, <code>--ignore-all-space<\/code><\/dt>\n<dd>\u7a7a\u767d\u6587\u5b57\uff08\u30b9\u30da\u30fc\u30b9\u6587\u5b57\u3068\u30bf\u30d6\u6587\u5b57\uff09\u306e\u5dee\u7570\u3092\u5168\u3066\u7121\u8996\u3059\u308b\u3002<\/dd>\n<\/dl>\n<dl>\n<dt><code>-b<\/code>, <code>--ignore-space-change<\/code><\/dt>\n<dd>\u884c\u672b\u7a7a\u767d\u6587\u5b57\u3068\u9023\u7d9a\u7a7a\u767d\u6587\u5b57\u306e\u5dee\u7570\u3060\u3051\u3092\u7121\u8996\u3059\u308b\u3002<\/dd>\n<\/dl>\n<p><\/p>\n<table>\n<tbody>\n<tr>\n<th>\u30aa\u30d7\u30b7\u30e7\u30f3<\/th>\n<th>\u5358\u4f53\u30b9\u30da\u30fc\u30b9<\/th>\n<th>\u9023\u7d9a\u30b9\u30da\u30fc\u30b9<\/th>\n<th>\u884c\u672b\u30b9\u30da\u30fc\u30b9<\/th>\n<\/tr>\n<tr>\n<td><code>--ignore-all-space<\/code><\/td>\n<td>\u7121\u8996<\/td>\n<td>\u7121\u8996<\/td>\n<td>\u7121\u8996<\/td>\n<\/tr>\n<tr>\n<td><code>--ignore-space-change<\/code><\/td>\n<td>\u6bd4\u8f03<\/td>\n<td>\u7121\u8996<\/td>\n<td>\u7121\u8996<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<hr>\n<p>&nbsp;<\/p>\n<h2>\u7d71\u8a08\u7684\u6bd4\u8f03<\/h2>\n<h3><code>--stat<\/code><\/h3>\n<p>\u5dee\u5206\u3092\u30b0\u30e9\u30d5\u30a3\u30ab\u30eb\u306b\u8868\u793a\u3059\u308b\u3002\u8ffd\u52a0\u3092+, \u524a\u9664\u3092-\u3068\u3057\u3066\u8868\u793a\u3059\u308b\u3002\u4eba\u51e6\u7406\u5411\u3051<\/p>\n<p>&nbsp;<\/p>\n<h3><code>--numstat<\/code><\/h3>\n<p>\u8ffd\u52a0\u884c\u6570, \u524a\u9664\u884c\u6570, \u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u306e\u9806\u306b\u30bf\u30d6\u533a\u5207\u308a\u3067\u8868\u793a\u3059\u308b\u3002\u6a5f\u68b0\u51e6\u7406\u5411\u3051\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3><code>--name-status<\/code><\/h3>\n<p>A:\u8ffd\u52a0, M:\u5909\u66f4, D:\u524a\u9664\u3068\u884c\u3092\u5206\u5272\u3057\u3066\u30bf\u30d6\u533a\u5207\u308a\u3067\u8868\u793a\u3059\u308b\u3002\u6a5f\u68b0\u51e6\u7406\u5411\u3051\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3><code>--shortstat<\/code><\/h3>\n<p>\u5909\u66f4\u6570\u3092\u30d5\u30a1\u30a4\u30eb\u3054\u3068\u3067\u306a\u304f\u96c6\u8a08\u3057\u305f\u5024\u306e\u307f\u8868\u793a\u3059\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Working \u3068 Index \u306e\u5dee\u5206 $ git diff<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[2],"class_list":["post-610","post","type-post","status-publish","format-standard","hentry","category-memo","tag-git"],"_links":{"self":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/comments?post=610"}],"version-history":[{"count":15,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/610\/revisions"}],"predecessor-version":[{"id":5706,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/610\/revisions\/5706"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}