1. Rename local branch (not yet pushed to origin)
    • git branch -m new-name From same branch
  2. Rename local and remote branch (already pushed to origin)
    • git branch -m new-name From same branch
    • git push origin :old-name new-name Delete old-name remote branch and push new-name local branch
    • git push origin -u new-name reset upstream branch for new-name local branch
  3. Set upstream branch for local branch before doing a push with git push origin -u BRANCH
    • git branch --set-upstream-to origin/BRANCH
  4. Check the remotes
    • git remote -v
  5. Change url for remote origin
    • git remote set-url origin https://REPOSITORY-URL.git