Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I rename my branch from TortoiseGit?

I know the way to rename branch from command line, but - since I'm using TortoiseGit - I'm curious if there are any options to do such thing.

Thanks for the answers :)

like image 472
Dombi Soma Avatar asked Mar 21 '16 14:03

Dombi Soma


People also ask

Can I rename my Git branch?

You created a new branch , pushed the changes to the remote repository, and realized that your branch name was incorrect. Luckily, Git allows you to rename the branch very easily using the git branch -m command.

How do I rename a branch in remote repository?

There isn't a way to directly rename a Git branch in a remote repository. You will need to delete the old branch name, then push a branch with the correct name to the remote repository.

Can I rename a branch in Devops?

Unfortunately, you are not able to rename a branch. However, you can create a new branch from the branch which you want to rename then you can delete that branch.


2 Answers

In a File Manager, Open your Project root directory (where your .git folder is found).

Right click and go to:

TortoiseGit > Switch/Checkout 

Ensure the 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.

Hit F2.

Rename your branch. Hit Enter. Click OK.

Now in the drop down menu, you'll find that the branch-name has been updated.

like image 144
Harmelodic Avatar answered Oct 09 '22 21:10

Harmelodic


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).

enter image description here

select the branch you want to rename and then press F2 (or select rename in the context menu).

enter image description here

See https://tortoisegit.org/docs/tortoisegit/tgit-dug-browse-ref.html

like image 33
MrTux Avatar answered Oct 09 '22 19:10

MrTux