Another way is to rename the following files:
.git/refs/head/[branch-name]
to .git/refs/head/new-branch-name
..git/refs/remotes/[all-remote-names]/[branch-name]
to .git/refs/remotes/[all-remote-names]/new-branch-name
.Rename head and remotes both on your local PC and on origins(s)/remote server(s).
If your current branch-name contains slashes (/
) Git will create the directories like so:
current branch-name: "awe/some/branch"
.git/refs/head/awe/some/branch
.git/refs/remotes/[all-remote-names]/awe/some/branch
wish branch-name: "new-branch-name"
branch
file from .git/refs/*/awe/some/
..git/refs/head/
.branch
file from all of .git/refs/remotes/*/awe/some/
..git/refs/remotes/*/
.branch
files to new-branch-name
..git/refs/head/new-branch-name
.git/refs/remotes/[all-remote-names]/new-branch-name
awe/some/branch
to new-branch-name
(local and remote!)Information: This way might not be the best, but it still works for people who might have problems with the other ways