How can I rename a local branch which has not yet been pushed to a remote repository?
Related:
Rename master branch for both local and remote Git repositories
How do I rename both a Git local and remote branch name?
To rename the current branch: git branch -m newname>\n\nTo rename a branch when referring to any branch: git branch -m oldname> \’newname\’.\n\n-m is short for –move.\n\nTo push the local branch and reset the upstream branch: git push origin -u newname> .\n\nTo remove the remote branch: git push origin –delete oldname> .\n\nTo create a git rename nicknames: GitHub config –global alias.name \’branch -m\’ .\n\nIf there are only capitalization changes in the name, use -M on Windows or another case-insensitive filesystem; otherwise, Git will throw a \”branch already exists\” error.