how to get list of all the branches in git and last commit with date and time code example
Example: view git branches most recent first
git for-each-ref --sort=-committerdate refs/heads/
# Or using git branch (since version 2.7.0)
git branch --sort=-committerdate # DESC
git branch --sort=committerdate # ASC