Jump to content
Mike Torrettinni

Is it possible to see Git current working branch in IDE?

Recommended Posts

@Lars Fosdal thanks, I know how the info is in Sourcetree, but i want to see in IDE what feature (branch) the opened project is about.

 

1 hour ago, Fr0sT.Brutal said:

Probably if you use CVS features of the IDE itself. I've never used it so can't say more precisely

Didn't know of it, will check. Thanks.

Share this post


Link to post

I enabled Git in IDE, but no info on what branch you are working on. Shame, it would pretty useful if there would very clear info, something like [Git: branch name], either in IDE title or in Project name in Project manager.

Too bad.

Share this post


Link to post

A custom wizard for this purpose must be pretty easy to implement 😉 or it probably could be added as a feature to expert monsters like GExperts or CnWizards

Share this post


Link to post

Hi...:classic_cool:

 

Is it possible to use TortoiseGit instead of SoureTree? Since TortoiseGIT looks at the local repository, it can mark the current path.

 

815_select.thumb.png.398c475236276e6a69a8e883a0770293.png

815_active.png

Share this post


Link to post
Quote

Mike wants to see the information in the RAD Studio IDE.

Everyone says no...but alternatives can solve the problem. :classic_happy:

Share this post


Link to post
12 minutes ago, Der schöne Günther said:

VS Code and two plug-ins (Git Graph & Gitlens) lead to a fantastic git experience, in my view.

 

The branch name is always visible at the bottom

image.thumb.png.66eb81b94ef5ac36b7e6423c2b0f59dd.png

Yes, that looks good. I assume the info stays there when switching to .cpp code, right?

Share this post


Link to post
12 minutes ago, haentschman said:

but alternatives can solve the problem

He's already using SourceTree which displays the information......

Share this post


Link to post

Right when this thread started I thought: This may quickly turn into a Git client contest.

Share this post


Link to post
3 minutes ago, Uwe Raabe said:

Right when this thread started I thought: This may quickly turn into a Git client contest.

No, no, that was not my intention... it's just about getting branch name into the Delphi IDE.

Share this post


Link to post
Just now, Mike Torrettinni said:

that was not my intention

I know, but I also know how these things are usually going.

Share this post


Link to post

Well, to my defense I also posted the native git command that in theory can be implemented in a plugin to the IDE 😉

 

I want to point out that I do not use multiple working directories for different versions of the same project. Always the same directory, but with the appropriate version checked out.

With multiple working directories, it is so easy to accidentally pull up a file from the history list which refers to a file in the wrong directory for the version that you wanted to work on.
That said, I can have multiple versions checked out to different folders when I do comparisons in Beyond Compare or VS Code - but I always use the same working folder when working on the code. 


Hence, I find it sufficient to let the git client show it to me.

Share this post


Link to post
1 hour ago, Mike Torrettinni said:

Yes, that looks good. I assume the info stays there when switching to .cpp code, right?

Sure. You can also click it to quickly check out some other branch/tag.

 

I haven't tried the VS Code integration in Delphi 11 yet, maybe that makes it even more appealing.

  • Like 1

Share this post


Link to post
23 hours ago, Lars Fosdal said:

git rev-parse --abbrev-ref HEAD

this works for me better, it gives me branch name:

git branch --show-current


while your suggestion gives me last commit id in current branch, so something like '6d2fab...'

Share this post


Link to post
1 minute ago, Mike Torrettinni said:

I have git version version 2.28.0.windows.1. You?

Never mind, I copy pasted another ? char in the line. They return the same! Sorry

Edited by Mike Torrettinni

Share this post


Link to post
On 9/16/2021 at 4:03 AM, Mike Torrettinni said:

Is it possible to somehow see what is current project branch I'm working on, in IDE?

I don't think your original question was ever answered--lots of other information, though.

 

To answer your question, No, the Delphi IDE does not show the current Git branch, only recent commits. It has a nice difference viewer that augments the History pane of the editor but that's it; it uses the current branch of the repository folder.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×