Help us understand the problem. What is going on with this article?

`git log --pretty=format` で tagを表示する方法

More than 1 year has passed since last update.

git log --pretty=format で tagを表示する」とはつまり、

[2018-07-27 23:13:04 +0900] ec017df : Merge branch 'b3.3_4.6'
[2018-07-10 23:09:09 +0900] cc0b4f3 : Fix IncursionMods


[2018-07-27 23:13:04 +0900] ec017df : Merge branch 'b3.3_4.6' tag: v3.3_4.6
[2018-07-10 23:09:09 +0900] cc0b4f3 : Fix IncursionMods


# 色なし
git log --pretty=format:'[%ad] %h : %s %D' --date=iso --decorate-refs=tags

# 色付き
git log --pretty=format:'%C(yellow)[%ad] %C(green)%h %Creset: %s %C(red)%D%Creset' --date=iso --decorate-refs=tags


%Dを使うとref nameとやらが表示されます。

$ git log --pretty=format:'[%ad] %h : %s %D' --date=iso
[2018-07-27 23:13:04 +0900] ec017df : Merge branch 'b3.3_4.6' HEAD -> master, tag: v3.3_4.6, origin/master

こんな感じ(HEAD -> master, tag: v3.3_4.6, origin/masterの部分)。


$ git log --pretty=format:'[%ad] %h : %s %d' --date=iso
[2018-07-27 23:13:04 +0900] ec017df : Merge branch 'b3.3_4.6'  (HEAD -> master, tag: v3.3_4.6, origin/master)


そんなとき--decorate-refs= オプションを使うことで%D, %dで表示するものを制御できます。




Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away