반응형
- git log --oneline
- 설명간략히 한줄로만 보여줌
- git log -5
- 최근 5개만 보여줌
- git log --grep=“some message”
- 커밋 메세지를 검색하여 보여줌
- git log --decorate --graph
- 그래프 형태로 보여줌
- git log --author=dhrim
- 특정저자 것만 보여줌
- git log --before={3.weeks.ago} --after={2010-04-18}
- 특정시기 것만 보여줌
- git log --pretty=format:"%h,%ar,%an : %s"
- commit 정보를 한줄 단위로 보여주되. format 에 맞게 보여줌
- git log --pretty=format:"%h %ad %an %x09 %s" --date=short
- %h : abbreviated commit Hash(간략)
- %an : author name
- %ad : author date (format respects --date= option)
- %ar : author relative date (--date=relative 설정효과, housrs ago, days ago)
- %as : author short date (--date=short 설정효과)
- %cd : comitter date (format respects --date= option)
- %d : ref names
- %s : subject(commit message)
- color setting
- %C(yellow), %C(cyan)
- %Cblue - 검은바탕에선 잘 안보임, %Cgreen
- %C(auto) %Creset
- log format 저장
- git config --global alias.hs '
gitlog --pretty="%C(yellow)%h %C(cyan)%as(%ar) %Cgreen%an %C(auto)%d %Creset%s"' -> git hs로 사용가능 - git config --global alias.hs "log --pretty='%C(yellow)%h %C(cyan)%cd %Cblue%aN%C(auto)%d %Creset%s' --graph --date=relative --date-order"
- git config --global alias.hs '
- git log --date=...
- --date=short: yyyy-mm-dd까지만 나옴
- --date=relative: housrs ago, days ago이렇게 나옴
- --date=raw: shows the date as seconds since the epoch (1970-01-01 00:00:00 UTC), followed by a space, and then the timezone as an offset from UTC
- --date=format:%d/%m/%y\ %H:%M:%S
- git log --graph
- Git GUI 툴처럼 graph로 보여줌
- reference
반응형
'git' 카테고리의 다른 글
git shortlog -s -n --all --no-merges(number of commits per author on all branches) (0) | 2022.09.02 |
---|---|
git log --reverse (첫번째 commit부터 반대순서로 조회) (0) | 2022.09.02 |
git help [알고싶은 명령어] (0) | 2022.07.21 |
[merge되돌리기]git cat-file -p HEAD로 부모알아낸후 git revert HEAD -m 1 (0) | 2022.07.21 |
과거 commit 검색하기: git log --grep='keyword', git show commitHash (0) | 2022.07.20 |