본문 바로가기
Git

Git] alias

by Fastlane 2024. 4. 29.
728x90
반응형

Git 명령어를 전부 입력하는 것이 귀찮다면 git config를 사용하여 alias를 설정할 수 있다. 

$ git config --global alias.slog "log --graph --all --topo-order --pretty='format:%h %ai %s%d(%an)'"

 

기존 git log

$ git log
commit 7d737ab2aa25cf0a3305a8fdbc3b14e7b2ebcab2 (HEAD -> master)
Author: test
Date:   Mon Apr 29 15:45:02 2024 +0900

    forth commit!

commit 16ddbd4f35f0da695cee79695c6cf368d6358ccf
Author: test
Date:   Mon Apr 29 13:39:04 2024 +0900

    third commit!

commit 6c97b4e128246d953f1864bd971523da5a2ce38b
Author: test
Date:   Mon Apr 29 13:38:35 2024 +0900

    second commit!

commit 02020f952645d911c3f681226590a4f3c42c3f88
Author: test
Date:   Mon Apr 29 13:38:03 2024 +0900

    first commit!

 

새로만든 alias인 git slog를 사용하면

$ git slog
* 7d737ab 2024-04-29 15:45:02 +0900 forth commit! (HEAD -> master)(test)
* 16ddbd4 2024-04-29 13:39:04 +0900 third commit!(test)
* 6c97b4e 2024-04-29 13:38:35 +0900 second commit!(test)
* 02020f9 2024-04-29 13:38:03 +0900 first commit!(test)

 

728x90
반응형

댓글