LoginSignup
1
1

More than 5 years have passed since last update.

時系列付きのリモートブランチ一覧を表示

Posted at

コマンドラインでも、GitHubやGitLabのように、ブランチの最終更新日時を確認できるようにする。

.gitconfigの設定

.gitconfigのaliasに、下記を追加。

[alias]
        remote-branch = !"for k in `git branch -r | grep -v HEAD | perl -pe s/^..//`; do echo `git show --pretty=format:'%Cgreen%ci %Cblue%cr%Creset' $k -- | head -n 1` \t$k; done | sort -r"

実行結果

$ git remote-branch
2013-11-08 15:07:58 +0900 46 minutes ago origin/dev
2013-11-08 12:09:08 +0900 4 hours ago origin/master
2013-11-08 10:33:06 +0900 5 hours ago origin/staging
1
1
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
1
1