- 追加された行はこの色です。
- 削除された行はこの色です。
#author("2019-06-11T05:07:28+09:00","default:ryuichi","ryuichi")
#author("2020-12-18T09:07:55+09:00","default:ryuichi","ryuichi")
* ブランチ一覧を時間でソート [#y0a1a1d5]
** --sort [#p5229bf3]
** --sort=<key> (Git 2.7以降) [#p5229bf3]
git branch -r -v --sort=-authordate
git branch -v --sort=authordate # コミットのタイムスタンプを昇順でソート
git branch -r -v --sort=-commiterdate # 取り込まれたコミットのタイムスタンプを降順(-)でソート
- -r リモートブランチ
- -v コミットIDやコミットログも表示
*** keyに指定できる値 [#u5470e1d]
https://git-scm.com/docs/git-for-each-ref
*** authordateとcommiterdate [#teef31a7]
- authordate ブランチを作った日時
- commterdate リベースするとauthordateは更新される
- https://stackoverflow.com/questions/11856983/why-git-authordate-is-different-from-commitdate
** Git のコミットのタイムスタンプには author date と committer date の 2 種類があるという話 [#z43a66c8]
https://vividcode.hatenablog.com/entry/git/author-date-and-committer-date
** git for-each-ref (Git 2.7より前) [#jd0c4681]
git for-each-ref --sort=-committerdate refs/heads/
https://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit/23944096