git diff ã®ä½¿ãæ¹ãã»ãã®å°ãç解ã§ãã
ãã¾ã¾ã§ãªãã¨ãªã使ã£ã¦ãããã©ããããã使ãæ¹ãåãã£ããããªæ°ãããã®ã§ã¡ã¢ã
åæç¥è
- ã¤ã³ããã¯ã¹ã¨ã¯ã¼ãã³ã°ããªã¼ãç解ã§ãã¦ãããã¨
- HEAD ãä½ãåãã£ã¦ãããã¨
git diff
ã¯ã¼ãã³ã°ããªã¼ã¨ã¤ã³ããã¯ã¹ã®å·®åã表示ã
git add ããå¾ã«ããã«ä¿®æ£ãããã©ãããããã°ã©ã®æç¹ã§ git add ããã®ããªã¼ãã¨ããã¨ãã«ä½¿ãï¼
git add ãããããã«ã³ãããããèªåã«ã¯é¢ä¿ãªãããã
git diff --cached
HEAD ã¨ã¤ã³ããã¯ã¹ã®å·®åã表示ã
git add ãã¦ãã³ãããããåã«å·®åã確èªãããæã«ä½¿ããã ã¨æãã
èªå㯠git diff ããããã£ã¡ã®æ¹ããã使ãã
git diff HEAD
HEAD ã¨ã¯ã¼ãã³ã°ããªã¼ã®å·®åã表示ã
åã«ã³ãããããæããã©ããããç·¨éããã確èªãããæã«ä½¿ãã
HEAD ã®é¨åã¯ã³ããã(HEADãHEAD^ ãã³ãããã®ããã·ã¥å¤)ããã©ã³ããã¿ã°ãæå®ã§ããã
git diff HEAD^..HEAD
ã³ãããéã®å·®åã表示ã
ããã 2 㤠(..) ã¯ç©ºç½ã§ã OKã(git diff HEAD HEAD^ ã¨åã)
ããã HEAD ã®ä»£ããã«ã³ãããããã©ã³ããã¿ã°ãæå®ã§ããã
git diff ã³ããããã®1...ã³ããããã®2
ã³ããããã®1ãã³ããããã®2 ã®å
±éã®è¦ªã¨ ã³ããããã®2 ã®å·®åã表示ã
ã³ããããã®1 㨠ã³ããããã®2 ãåããã©ã³ãã ã¨ä¸ã®ãã¼ã¸ã§ã³ã¨åãçµæã«ãªãã
ã¤ã¡ã¼ã¸ã§è¦ãã»ããå¤ååããããã
git diff Y...D (ããã 3 ã¤ç)
åè: git diff Y..D (ããã 2 ã¤ç)
ãã以å¤ã«ãããããä½ã£ãããåºåå½¢å¼ãããã£ããã¨ããããã§ããããã ã
ãã ãæ£ç´ããã¾ã§ä½¿ãããªããæ°ãããªããã使ãããªãæ°ãããªãã
ãã£ã¨ä½¿ãããªããã人ã¯ããã¥ã¢ã«ãåç
§ãã¦ãã ããã
git-diff(1)