25
24

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

任意の日付フォーマットでgit logを表示する

Posted at

メモ

git logのフォーマットを指定する
http://qiita.com/harukasan/items/9149542584385e8dea75

上のリンクにあるように $ git log --date=<option> でいくつかのオプションを指定できるのですが
local, iso, rfcは文字列が長いし、shortだと日時が表示されません。
$ git log --oneline$ git log --graph の時に短くて自分にとって視認性の高いフォーマット指定やりたいですよね。

こんな指定をすれば、任意のフォーマットで表示できます。
--date=format:'%Y/%m/%d %H:%M:%S'

sample

$ git log --oneline --pretty=format:'%h [%cd] %d %s <%an>' --date=format:'%Y/%m/%d %H:%M:%S'
8e3fce6 [2017/01/23 06:18:17]  (HEAD -> master, origin/master, origin/HEAD) aliases <nobuyasu tomura>
967ce49 [2017/01/23 06:18:17]  npm-debug.log.*対策 <nobuyasu tomura>
6609919 [2017/01/23 06:18:17]  sdkman, aws cli complettioon, http status 確認コマンド の設定 <nobuyasu tomura>
aeea2f8 [2017/01/23 06:18:17]  rustの設定など <nobuyasu tomura>
25
24
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
25
24

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?