Fri 11 Nov 2022

List your Git branches by recent activity

Even if you’re diligent and regularly delete merged and stale branches you may still find it hard to pick out a particular branch from the alphabetically-sorted output of git branch. How about something more useful, like seeing them listed based on their freshness?

The git branch command accepts a --sort option which we can use to list our branches based on the last committer date:

$ git branch --sort=-committerdate  * main    redact-abandoned    log-downloads    i18n-lint

Related posts

01/05

Fri 11 Nov 2022

Exclude linting & formatting commits when running Git blame

Fri 11 Nov 2022

Better Git diff output for Ruby, Python, Elixir, Go and more

Fri 11 Nov 2022

Why Git blame sucks for understanding WTF code (and what to use instead)

Fri 11 Nov 2022

How focused commits make you a better coder