Get the latest tech news
Sort branches by last commit date
TIL: Sort branches by last commit date I have too many git branches and like many people I developed a convoluted script to show me the most recent ones. I ran this command many times a day for years: function branches { for k in `git branch | sed "s/^..//"`; do echo -e `git log --color -1 --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" "$k"`\\t"$k"; done | sort } This outputs the date as the first column in the output so that sort works.
None
Or read this on Hacker News

