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
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.
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.
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 .
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
Second (and most handy) is to use the Git widget in the Status bar:
The remote tracking branch though, does not seem to be displayed, except when you are pushing the branch via menu VCS - Git - Push
For that, a git branch -avv
in command line remains the most complete source of information.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With