Updated:

Git 기본 명령어를 정리한 네번째 글입니다.

1. git diff?

git diff는 파일의 어떤 내용이 변경되었는지 비교할 수 있는 명령어 입니다. git diff 명령어는 commit간의 비교 뿐 아니라, Working Directory와 Staging Area의 파일간 비교, branch간의 비교도 가능합니다.

2. git diff 명령어

  • git diff : commit된 파일과 변경사항이 발생한(Unstaged) 파일 비교
  • git diff --staged : commit된 파일과 Staging area의 파일 비교
  • git diff [commit 해쉬1] [commit해쉬2]: commit 파일 간의 상태 비교
  • git diff HEAD HEAD^ : 가장 최근의 커밋과 그 전의 커밋을 비교
  • git diff [branch1] [branch2] : branch간의 상태 비교


Reference


https://wikidocs.net/150611

Tags:

Categories:

Updated:

Leave a comment