git log --oneline --decorate --graph --all
2024. 7. 25. 05:51ㆍGit
git log --oneline --decorate --graph --all
명령어에서--decorate
옵션은 각 커밋에 연결된 참조(ref) ― 즉 브랜치명, 태그명, HEAD 등을
커밋 메시지 옆에 표시해주는 역할을 합니다.
🔍 --decorate
옵션 설명
- 커밋 메시지 옆에 현재 이 커밋을 가리키는 포인터 목록을 출력합니다.
- 예를 들어 브랜치
main
과 HEAD가 같은 커밋을 가리키고 있다면 다음처럼 표시됩니다:
* 1a2b3c4 (HEAD -> main) Initial commit
여기서:
HEAD -> main
은 현재 브랜치(main)가 HEAD에 연결되어 있음을 뜻함- 만약 이 커밋에 태그가 있으면
(HEAD -> main, tag: v1.0)
처럼 표시됨
예제: --decorate
없는 출력
git log --oneline --graph
* 1a2b3c4 Initial commit
* 9f8e7d6 Add README
예제: --decorate
포함한 출력
git log --oneline --graph --decorate
* 1a2b3c4 (HEAD -> main) Initial commit
* 9f8e7d6 Add README
예제: git log --oneline --decorate --graph --all
$ git log --oneline --decorate --graph --all
* 364fefd (HEAD -> feature) Add feature 2
* 68ded86 (main) Another update from main branch
* cd25ab9 Update from main branch
* 603ac70 1st commit
🎯 정리
옵션 | 의미 |
---|---|
--decorate |
커밋 옆에 현재 브랜치, 태그 등의 포인터 정보를 함께 출력 |
--oneline |
각 커밋을 한 줄로 요약 |
--graph |
커밋 관계를 아스키 그래프로 표시 |
--all |
모든 브랜치의 커밋 로그를 보여줌 |
'Git' 카테고리의 다른 글
remote repository를 local host pc에 add하는 방법 (0) | 2025.05.08 |
---|---|
GitBash Credentials 수정 (0) | 2024.11.14 |
Refs (0) | 2024.07.24 |
git diff (0) | 2023.12.12 |
Tracking branch와 Upstream (0) | 2023.06.30 |