DevOpsGitList branches ahead or behind remoteList branches ahead or behind remote git branch -v | grep -E 'ahead|behind' | sed -r 's/[ *]\s(\S*).*(\[(ahead|behind).+?\]).*/\1 \2/g' See reference.