How can I rename my branch from TortoiseGit?
If you want to rename a branch which is not the current branch, open the Reference Browser using the context menu of a versioned folder (you might need to hold the Shift key when opening it).
select the branch you want to rename and then press F2 (or select rename in the context menu).
In a File Manager, Open your Project root directory (where your
.git folder is found).
Right click and go to:
TortoiseGit > Switch/Checkout
Switch To Option to
Branch. Then click the little button to the side of the drop down menu that is denoted by
A window will pop up showing the list of branches for you to choose.
Click on the one you want to rename.
Rename your branch. Hit Enter. Click OK.
Now in the drop down menu, you'll find that the branch-name has been updated.
If you want to rename just the local branch, you can refer to other answers. Please follow these steps to rename local and remote branch.
- Right click the repository -> TortoiseGit -> Browse References.
- Select the branch you want to rename and hit F2 button and type a new name. The branch is now been renamed locally.
- Right click the renamed branch and select "switch/checkout to this.."
- Now right click the repository and select "Git Commit -> "renamed branch"
- Git commit window will open. Type a commit message and tick the checkbox "Message Only" in the bottom left corner, and then click "Commit & Push"
Press the upvote button if this answer has helped you.