블로그 이미지
Peter Note
Web & LLM FullStacker, Application Architecter, KnowHow Dispenser and Bike Rider

Publication

Category

Recent Post

2012. 11. 22. 11:11 Git, GitHub

diff는 commits 된 것들 사이에서 차이를 보기위한 방법이다. (참조

어디에서 수행할 수 있는가?

  • workspace 입장 (Working Directory)
    • git diff : "workspace" <- "index"
    • git diff HEAD or <another branch> : "workspace" <- "local repository"
  • index 입장 (Stage)
    • git diff : "workspace" <- "index"
    • git diff --cached : "index" <- "local repository"
  • local repository 입장
    • git diff HEAD  or <another branch>  : "workspace" <- "local repository"
    • git diff <commit 1> <commit 2> : "local repository" commit 1 -> commit 2
    • git diff --cached : "index" <- "local repository" 


위 내용에 대한 정리를 보자. 

> local repository 내부 비교 : git diff <commit> <commit>  예) git diff da985 b325c
> local repository와 index 비교 : git diff --cached
> local repository 특정 branch와 workspace 비교 : git diff HEAD 또는 git diff maint

> index와 workspace 비교 : git diff



posted by Peter Note