Use git-for-each-ref to check whether the origin branch exists.