Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pycharm to show current working branch name

Tags:

git

pycharm

When viewing VCS window in Pycharm IDE, I have no idea what git local branch I'm working on as well as its mapped git remote branch.

So how to show current working branch name in Pycharm?

p.s.

I'm using PyCharm Community Edition 2016.2

like image 987
Nam G VU Avatar asked Jul 28 '16 04:07

Nam G VU


People also ask

How do I show current branch in IntelliJ?

As of IntelliJ 11 the current Git branch is displayed in the bottom right corner of the status bar. Moreover, clicking on the branch name displays a nice popup with all available branches, and you can invoke some actions on them.

How do I fetch the latest branch?

just need to run git fetch , which will retrieve all branches and updates, and after that, run git checkout <branch> which will create a local copy of the branch because all branches are already loaded in your system.

How do I display a remote branch?

To view your remote branches, simply pass the -r flag to the git branch command. You can inspect remote branches with the usual git checkout and git log commands. If you approve the changes a remote branch contains, you can merge it into a local branch with a normal git merge .


2 Answers

Local Working Branch

The section "Which branch we are working in?" is quite clear:

Actually, this information is available in the Logs tab, but there are two another ways to see the current branch.

First, there is a special command on the main menu VCS→Git→Branches. The pop-up window of existing branches appears

https://confluence.jetbrains.com/download/attachments/51959419/git6.png?version=1&modificationDate=1377102558000&api=v2

Second (and most handy) is to use the Git widget in the Status bar:

enter image description here

Remote mapped branch

The remote tracking branch though, does not seem to be displayed, except when you are pushing the branch via menu VCS - Git - Push

https://www.safaribooksonline.com/library/view/mastering-pycharm/9781783551316/graphics/1316_09_07.jpg

For that, a git branch -avv in command line remains the most complete source of information.

like image 180
VonC Avatar answered Sep 21 '22 13:09

VonC


A small update to the wonderful answer by @VonC: there is an option to show the git branch in the git widget in the bottom of the screen. It's called Show Git Branch and you can turn it on either using the command lookup or from View > Appearance > Status Bar Widgets > Git Branch. enter image description here

like image 24
Krzysztof Chris Mejka Avatar answered Sep 18 '22 13:09

Krzysztof Chris Mejka