본문 바로가기

Python_Beginer/GIT

[GIT]Git Diff(변경 사항 확인)

반응형

1. Git Diff

: 작업트리에 있는 파일과 스테이지에 있는 파일을 비교

 스테이지에 있는 파일과 저장소에 있는 최신 커밋을 비교해서 수정한 파일을 커밋하기 전에 검토

 

2.

$ vim hello.txt
$ git status
$ git diff

warning: LF will be replaced by CRLF in hello.txt.
The file will have its original line endings in your working directory
diff --git a/hello.txt b/hello.txt
index 1191247..0b66db0 100644
--- a/hello.txt
+++ b/hello.txt
@@ -1,2 +1,2 @@
 1
-2
+two

 

3. 최신버전과 비교하여 달라진 곳

 

- 2 ( 2가 삭제됨 )

+ two ( two가 추가됨 )

 

반응형