Serena Xu
Serena Xu

Reputation: 255

How to list most recent 10 remote branches in git

I want to get most recent 10 remote branches using git. I know I can use git branch -r --sort=-committerdate to get all remote branches sorted by committerdate. But I want to know, how I can select the most 10 recent remote branches ?

Upvotes: 2

Views: 227

Answers (1)

hedengran
hedengran

Reputation: 63

You could pipe it to head:

git branch -r --sort=-committerdate | head -n 10

Upvotes: 2

Related Questions