Use git for-each-ref instead of git branch to check the existence of a branch.
Like cherry-pick, but to move instead of copy.