简体   繁体   中英

How to rename a local Git branch from inside IntelliJ IDEA?

There are plenty of things you can do with Git plugin for IntelliJ IDEA, but I haven't found a way to rename a branch. Is there one?

I know I can always bring up a terminal and do git branch -m source target , but I expected to find a GUI solution as well.

There are a couple of pending issues with this feature:

The latter is not yet implemented.
The former does show the only way (mentioned by the OP) currently available:

Go to the command line and execute git branch -m <old_name> <new_name>

But even that has refresh issue on IDEA.


Update January 2017: IDEA-131021 might have been implemented, as illustrated by Pavlo Zvarych 's answer . It is consistent with the proposal :

introduce menu item in Git | Branches Git | Branches popup for current branch and place the actions related to the current branch in its second-level submenu.

https://youtrack.jetbrains.com/_persistent/image.png?file=74-343247&c=true&rw=526&rh=121&u=1473876457355

VCS > Git > Branches...

  1. Click on the right arrow of your project (look at Repositories ).

  2. The sub-window with branches will appear. Click on the right arrow of the branch you want to rename.

  3. Rename.

If you want to rename a branch you currently on. You have to checkout to another branch and then to find your branch in a way described above and rename it.

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM