Skip to content

Instantly share code, notes, and snippets.

// Regex to parse "git branch -a -vv"
(\*)? +(.*?) +(.*?)? ((\[(.*?)(: (.*?) (\d+))?\])? ?(.*$))?
// 0 the whole thing
// 1 if there is a * (active)
// 2 branch name
// optional after this
// 3 most recent commit short sha
// 4-5 ignore