git branch の結果を時間順にソート

ブランチが大量にあると、git branch の結果を最終更新時間でソートして表示したくなりますよね。以下のワンライナーでできます。

(for i in `git branch | colrm 1 2` ; do echo `git log --date=iso8601 -n 1 --pretty="format:[%ai] %h" $i` $i ; done) | sort -r

git branch を最終更新の日付でソートするオプションがほしい

Kazuho Oku on Twitter: "git branch を最終更新の日付でソートするオプションがほしい"

ってツイートしたら、@likk さんに、

@kazuho https://gist.github.com/Likk/9af89b10fd0008df91adワンライナー書いたのでこれをgitのエイリアスに。

永遠に靴紐がほどける on Twitter: "@kazuho https://t.co/RWHu84yP ワンライナー書いたのでこれをgitのエイリアスに。"

って教えてもらいました。ありがとうございます!!! でも使おうとしたら Perl モジュールが足りなくて悲しいことになったので、perl 使わないように書きなおした次第。

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy