git checkout remote branch and rename code example
Example 1: git rename local branch
git branch -m <oldname> <newname>
Example 2: git checkout branch from remote to local
git checkout -b test origin/test
// making a local copy of the branch called "test" from origin.