rename pushed branch code example
Example 1: rename branch git
git branch -m <new_name>
Example 2: git rename local branch
git branch -m <oldname> <newname>
Example 3: edit branch name git
$ git checkout Branch-Name-You-Want-to-Change
$ git branch -m New-Branch-Name
Example 4: rename a branch alredy pushed
#checkout to the branch
git checkout old_branch_name
#in the same branch run the command
git branch -m new_branch_name