How do you sort git branches by latest commit?
To sort git branches with the most recent commit first, open the terminal and run
git branch --sort=-committerdate
This command will display a list of branches in descending order based on the latest commit date. The branch with the most recent commit will be shown at the top of the list, while the branch with the oldest commit will be at the bottom.