Git
[Git 입문편] 3. status, log
미래의 개발왕
2021. 3. 4. 23:12
728x90
반응형
본 포스팅은 저의 인터넷 강의인 실무자가 알려주는 Git - 입문편의 강의안을 바탕으로 작성하였습니다.
status (st)
현재 git이 관리하는 파일들의 상태를 보여준다. 어떤 파일들이 Untracked인지, Staged인지, Unmodifed인지 등을 알 수 있다.
Untracked files : Untracked 상태인 파일들
cd ~/git-exer
echo "status exer" >> st.md
git st
---
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
st.md
nothing added to commit but untracked files present (use "git add" to track)
Changes to be committed: Staged 상태인 파일들
git add st.md
git st
---
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: st.md
nothing to commit, working tree clean: Unmodified 상태인 파일들
git ci -m 'Make st.md'
git st
---
On branch master
nothing to commit, working tree clean
log (lg)
- 히스토리를 조회하는 명령어
- 커밋 단위로 히스토리가 쌓임
- log를 볼 줄 알아야 develop, release, hotfix 브랜치가 난무할 때 merge 방향이나 순서를 이해할 수 있음
- 위에 있는 것이 최신, 아래 있을 수록 예전 커밋
git lg
---
* ab118e1 - (73 minutes ago) Make st.md - Country
* e5d33ad - (2 days ago) initial commit - Country (origin/master)
반응형