<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/sorting-git-branches-cam529gk0" -->

---
title: Sorting Git branches | daily.dev
description: Learn how to sort Git branches by the date of their last commit.
canonical: https://daily.dev/posts/sorting-git-branches-cam529gk0
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Sorting Git branches | daily.dev
og:description: Learn how to sort Git branches by the date of their last commit.
og:url: https://daily.dev/posts/sorting-git-branches-cam529gk0
og:image: https://api.daily.dev/og/posts/cam529Gk0.png
og:image:alt: Sorting Git branches
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Sorting Git branches

**[Cassidy's blog](https://daily.dev/sources/cassidoo)** · [@cassidoo](https://daily.dev/cassidoo) · 1 min read · 24 upvotes · 3 comments

## Summary

Learn how to sort Git branches by the date of their last commit.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.cassidoo.co/post/sort-git-branch/>

## Community discussion

Top comments from developers on daily.dev.

**@soysarcasme** · 1 upvotes

> Amazing post Cassidy 😁

**@allefsousa** · 0 upvotes

> Great post Cassidy!

**@aishwarygupta** · 0 upvotes

> A good read 👍🏻
> '' git branch --sort=-committerdate '' -> will sort all of your branches by the date of their last commit!

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 1 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

Tags: [#git](https://daily.dev/tags/git), [#version-control](https://daily.dev/tags/version-control)

[View this post on daily.dev](https://daily.dev/posts/sorting-git-branches-cam529gk0)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Sorting Git branches","url":"https://daily.dev/posts/sorting-git-branches-cam529gk0","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/sorting-git-branches-cam529gk0"},"datePublished":"2024-02-15T16:03:55.140Z","dateModified":"2024-05-09T08:43:33.910Z","description":"Learn how to sort Git branches by the date of their last commit.","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/588e66422f67298b9201866ab23d482b?_a=AQAEufR","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/588e66422f67298b9201866ab23d482b?_a=AQAEufR","isAccessibleForFree":true,"articleSection":"Cassidy's blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Person","name":"Cassidy Williams","url":"https://daily.dev/cassidoo","image":"https://avatars.githubusercontent.com/u/1454517?v=4","description":"making memes and dreams and software","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":2220}},"commentCount":3,"discussionUrl":"https://daily.dev/posts/sorting-git-branches-cam529gk0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":24},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":3}],"keywords":"git,version-control","timeRequired":"PT1M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Cassidy's blog","item":"https://daily.dev/sources/cassidoo"},{"@type":"ListItem","position":3,"name":"Sorting Git branches"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/sorting-git-branches-cam529gk0","comment":[{"@type":"Comment","text":"Amazing post Cassidy 😁","datePublished":"2024-02-15T16:59:16.927Z","url":"https://daily.dev/posts/cam529Gk0#c-a6qPxCt7g","author":{"@type":"Person","name":"paul","url":"https://daily.dev/soysarcasme","image":"https://avatars.githubusercontent.com/u/85648028?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"Great post Cassidy!","datePublished":"2024-02-22T22:21:13.402Z","url":"https://daily.dev/posts/cam529Gk0#c-knDJ0f4Zk","author":{"@type":"Person","name":"Allef sousa","url":"https://daily.dev/allefsousa","image":"https://media.daily.dev/image/upload/s--w11sp7jK--/f_auto/v1708052584/avatars/avatar_0Uh3AAswpd9KEKrsEMSgp"}},{"@type":"Comment","text":"A good read 👍🏻\n‘’ git branch --sort=-committerdate ‘’ -&gt; will sort all of your branches by the date of their last commit!","datePublished":"2024-02-19T14:53:47.900Z","url":"https://daily.dev/posts/cam529Gk0#c-rbhuOXZPn","author":{"@type":"Person","name":"Aishwary Gupta","url":"https://daily.dev/aishwarygupta","image":"https://lh3.googleusercontent.com/a/ACg8ocI36_-Z3SwDSh597IcUeISf2MC_Dnk8THs9LHmNpLqDHs5y=s96-c"}}]}
```

