일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- JavaScript
- TypeScript
- github
- @media
- webpack
- HTML
- 코드업
- react
- redux
- 반응형 페이지
- media query
- 변수
- java
- JS
- git
- Servlet
- coding
- 프론트엔드
- cleancode
- 자바
- 그럼에도 불구하고
- 자바문제풀이
- react-router-dom
- max-width
- CSS
- 그럼에도불구하고
- node.js
- frontend
- node
- 코딩테스트
- Today
- Total
그럼에도 불구하고
[Git, GitHub] Gif Diff란? 본문
Git Diff에 대해 알아보겠습니다.
목차
[ Gif Diff ]
git diff 명령을 사용하면 commit, branch, file, 작업 디렉터리 간의 변경 사항을 볼 수 있습니다.
또한 git status 및 git log와 같은 명령과 함께 git diff를 사용하여 레포지토리에 대한 더 나은 그림과 시간이 지남에 따라 변경된 방식을 얻을 수 있습니다.
git diff는 저장소에서 어떤 작업도 하지 않으며, git status나 git log처럼 아무런 영향도 미치지 않습니다. 순수하게 정보를 주는 명령어입니다.
📌 git diff
git diff
이 명령은 다음 commit을 위해 stage에 등록되지 않은 워킹 디렉터리의 변경 사항을 모두 나열합니다.
따라서 워킹 디렉터리와 stage 영역 간 변경 사항을 비교합니다.
📌 git diff HEAD
git diff HEAD
git diff HEAD를 실행하면, HEAD가 가리키는 최신 commit과 워킹 디렉토리 간의 차이를 보여줍니다.
📌 git diff --staged or --cached
git diff --staged
git diff --cached
두 옵션 모두 stage에 등록된 변경사항만을 보여줍니다.
📌 diff-ing specific files
git diff HEAD [filename]
git diff --staged [filename]
diff의 범위를 특정 파일이나 파일들로 좁혀서 확인할 수 있습니다.
📌 comparing branches
git diff branch1..branch2
or
git diff branch1 branch2
git diff를 사용해서 두 branch를 비교할 수도 있습니다.
📌 comparing commits
git diff commit1..commit2
or
git diff commit1 commit2
두 commit 간의 어떤 것이 변경되었는지 알려줍니다.
🏷️ 예제
https://plum-poppy-0ea.notion.site/Git-Diff-Exercise-f7829bd2783940cea14239022a6c37a9
Git Diff Exercise
This exercise comes with a starter repo that you will need to clone down to your machine. We will be working with two bands: Queen and Fleetwood Mac and their various lineups over the years.
plum-poppy-0ea.notion.site
'이모저모 > Git, GitHub' 카테고리의 다른 글
[Git, GitHub] 다양한 명령어들에 대해 알아보자 (checkout, restore, reset, revert) (0) | 2023.07.13 |
---|---|
[Git, GitHub] git stash란? (0) | 2023.07.11 |
[Git, GitHub] 브랜치(branch) 병합(merge)하기 (0) | 2023.07.06 |
[Git, GitHub] branch(브랜치)에 대해 알아보자 (0) | 2023.07.03 |
[Git, GitHub] commit, commit message 수정하는 법 (0) | 2023.06.30 |