"Git diff"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-<source lang='cli'> +<source lang='console'>))
 
(다른 사용자 한 명의 중간 판 7개는 보이지 않습니다)
1번째 줄: 1번째 줄:
==개요==
==개요==
;git diff
;git diff
* 작업디렉토리와 스테이징영역의 차이를 확인하는 git 명령어
* 작업디렉토리와 스테이징영역의 차이를 확인하는 [[git 명령어]]


==실습==
==실습==
<source lang='cli'>
* 사전작업: [[git commit]] 실습
root@zetawiki:~# mkdir -p workspace/hello
<source lang='console'>
root@zetawiki:~# cd workspace/hello/
root@zetawiki:~/workspace/hello# echo 'good morning' >> greet.txt
root@zetawiki:~/workspace/hello# git init
root@zetawiki:~/workspace/hello# cat greet.txt
Initialized empty Git repository in /root/workspace/hello/.git/
hello world
good morning
</source>
</source>
<source lang='cli'>
<source lang='console'>
root@zetawiki:~/workspace/hello# echo 'hello world' > greet.txt
root@zetawiki:~/workspace/hello# git add greet.txt
root@zetawiki:~/workspace/hello# git commit -m 'hello world!'
[master (root-commit) 0794230] hello world!
Committer: root <root@zetawiki.example.com>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
 
    git config --global user.name "Your Name"
    git config --global user.email you@example.com
 
After doing this, you may fix the identity used for this commit with:
 
    git commit --amend --reset-author
 
1 file changed, 1 insertion(+)
create mode 100644 greet.txt
</source>
<source lang='cli'>
root@zetawiki:~/workspace/hello# echo 'good morning' >> greet.txt
root@zetawiki:~/workspace/hello# git diff greet.txt
root@zetawiki:~/workspace/hello# git diff greet.txt
diff --git a/greet.txt b/greet.txt
diff --git a/greet.txt b/greet.txt
44번째 줄: 24번째 줄:
==같이 보기==
==같이 보기==
*[[git commit]]
*[[git commit]]
*[[git checkout]]
*[[git 명령어]]
*[[git 명령어]]
*[[리눅스 diff]]
*[[리눅스 diff]]


[[분류: git]]
[[분류: git]]

2016년 3월 29일 (화) 10:30 기준 최신판

1 개요[ | ]

git diff
  • 작업디렉토리와 스테이징영역의 차이를 확인하는 git 명령어

2 실습[ | ]

root@zetawiki:~/workspace/hello# echo 'good morning' >> greet.txt
root@zetawiki:~/workspace/hello# cat greet.txt
hello world
good morning
root@zetawiki:~/workspace/hello# git diff greet.txt
diff --git a/greet.txt b/greet.txt
index 3b18e51..f066315 100644
--- a/greet.txt
+++ b/greet.txt
@@ -1 +1,2 @@
 hello world
+good morning

3 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}