💡 작업 디렉토리(working directory)와 스테이징 영역(staging area)의 상태를 확인하기 위해서 사용한다.
git status
git status의 결과를 보면 크게 3개의 영역으로 구분이 되어 있는 것을 볼 수 있다.
$ git status
On branch search3
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: src/components/Control/Control.jsx
modified: src/components/Input/Input.jsx
modified: src/components/List/ListItem.jsx
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: src/components/Search/Search.jsx
modified: src/components/Search/Search.stories.jsx
Untracked files:
(use "git add <file>..." to include in what will be committed)
src/components/Search/useSearch.js
Changes to be committed: staging area로 넘어가 있는 변경내용을 보여준다.
*Changes not staged for commit:* working directory에 있는 변경 내용을 보여준다.
Untracked files: working directory에 있으며, git이 관리한적 없는 새로운 파일을 보여준다.
git reset HEAD <파일>
git checkout -- <파일>