5
4

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のbranchを新しい順に並べる方法(git v2.19以降)

Last updated at Posted at 2018-09-14

gitのversion 2.19でbranchのsortオプションに新しくauthordateが追加された
これを使えばgit branchコマンドの結果がauthordate順に並ぶようになる。

いろんなbranchを行き来していてどのbranchを作業していたか忘れがちなので
これを使えば前に作業していたbranchが見つけやすくなる

git branch --sort=authordate #古い順
git branch --sort=-authordate #新しい順

defaultでsort順を変えたい時はgit configで設定しておくと便利

git config --global branch.sort -authordate

参考

5
4
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
5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?