5
6

More than 5 years have passed since last update.

git logを見やすく設定

Posted at

素のままのgit-logだとごちゃごちゃしていて読みにくい
なので

git-log

$ git log --pretty=format:\"%C(yellow)%h %C(White)%ad | %C(White)%s%C(Green)%d %C(Red)[%an]\" --graph --date=short  

  

Qiitaって画像貼れなかったっけ…… #[5.24追記] 貼れました、ongaeshiさんありがとうございます!

terminal

これで上のスクリーンショットみたいな感じに、
左からグラフ、ハッシュ(黄色)、日付(白文字) | コメント(白文字)ブランチ名(緑) [コミット者(赤)]というようにコンパクトに表示されるはず。

%C(colorname)って感じみたいだ。
詳しいところはgit-configあたりを参考に。
これ以上のことをしようとするなら、tigあたり使った方が良いのではないかなーとか思ってしまう。

  
ついでに

.gitconfig

[alias]
    hist = log --pretty=format:\"%C(yellow)%h %C(White)%ad | %C(White)%s%C(Green)%d %C(Red)[%an]\" --graph --date=short

みたいに、gitconfigにエイリアスを設定をするとちゃちゃっと確認したいときに便利です。

色や属性の設定など、ターミナル依存なところもあったりするので注意

5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6