> For the complete documentation index, see [llms.txt](https://roharon.gitbook.io/hufs-missing-semester/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://roharon.gitbook.io/hufs-missing-semester/undefined/git-log.md).

# git log 화려하게 설정하기

git cli에서 기본 제공되는 히스토리 조회 명령어`git log` 입니다. 기본적인 커밋 로그에 대해 확인할 수 있지만, Github, Bitbucket에서 보여주는 알록달록한 그래프의 형태는 나오지 않습니다.

![](/files/-MSXxb9lHIGLSblXbcaF)

`~/.gitconfig` 파일을 통해 git의 설정을 변경할 수 있습니다.

첫번째 강의 챕터에서 기본 브랜치를 `main` 으로 변경한 내용도 아래의 내용처럼 이 파일에서 관리하게 됩니다.

```bash
[init]
        defaultBranch = main
```

아래에 `alias` 로 별칭을 두어 커맨드를 만들 수 있습니다.

```yaml
[alias]
        lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(cyan)%h%C(reset) - %C(green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(yellow)%d%C(reset)' --all
        lg = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n''          %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
        lg3 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
        
```

아래 이미지는 lg 커맨드를 실행했을때 나오는 예시입니다

![](/files/-MSXzy2misNO6yDtFGP_)
