BitBucket users: fix error on Step 2 if renaming master, in Repo Details set the default branch to new branch. The error is: By default, deleting the current branch is denied, because the next 'git clone' won't result in any file checked out, causing confusion. You can set 'receive.denyDeleteCurrent' configuration variable to 'warn' or 'ignore' in the remote repository to allow deleting the current branch, with or without a warning message. To squelch this message, you can set it to 'refuse'. error: refusing to delete the current branch: refs/heads/master, This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered., I have a local branch master that points to a remote branch origin/regacy (oops, typo!). How do I rename the remote branch to origin/legacy or origin/master? I tried: git remote rename regacy legac.