Mike Torrettinni 198 Posted September 16, 2021 Is it possible to somehow see what is current project branch I'm working on, in IDE? I use SourceTree for Git. Share this post Link to post
Lars Fosdal 1792 Posted September 16, 2021 Not really well versed in SourceTree, but GitKraken is very explicit about it. Otherwise, git rev-parse --abbrev-ref HEAD in your working folder, according to https://stackoverflow.com/questions/6245570/how-to-get-the-current-branch-name-in-git 1 Share this post Link to post
Fr0sT.Brutal 900 Posted September 16, 2021 Probably if you use CVS features of the IDE itself. I've never used it so can't say more precisely 1 Share this post Link to post
Mike Torrettinni 198 Posted September 16, 2021 @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
Mike Torrettinni 198 Posted September 16, 2021 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
Fr0sT.Brutal 900 Posted September 17, 2021 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
haentschman 92 Posted September 17, 2021 Hi... Is it possible to use TortoiseGit instead of SoureTree? Since TortoiseGIT looks at the local repository, it can mark the current path. Share this post Link to post
Der schöne Günther 316 Posted September 17, 2021 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 Share this post Link to post
David Heffernan 2345 Posted September 17, 2021 I don't understand most of the answers. Mike wants to see the information in the RAD Studio IDE. Share this post Link to post
Lars Fosdal 1792 Posted September 17, 2021 Well, yeah, good luck with that. Share this post Link to post
haentschman 92 Posted September 17, 2021 Quote Mike wants to see the information in the RAD Studio IDE. Everyone says no...but alternatives can solve the problem. Share this post Link to post
Mike Torrettinni 198 Posted September 17, 2021 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 Yes, that looks good. I assume the info stays there when switching to .cpp code, right? Share this post Link to post
David Heffernan 2345 Posted September 17, 2021 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
Uwe Raabe 2057 Posted September 17, 2021 Right when this thread started I thought: This may quickly turn into a Git client contest. Share this post Link to post
Mike Torrettinni 198 Posted September 17, 2021 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
Uwe Raabe 2057 Posted September 17, 2021 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
Lars Fosdal 1792 Posted September 17, 2021 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
Fr0sT.Brutal 900 Posted September 17, 2021 Fill a request to QC 🙂 I guess it would be quite easy to implement Share this post Link to post
Der schöne Günther 316 Posted September 17, 2021 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. 1 Share this post Link to post
Mike Torrettinni 198 Posted September 17, 2021 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
Lars Fosdal 1792 Posted September 17, 2021 Odd. They show the same for me. Share this post Link to post
Mike Torrettinni 198 Posted September 17, 2021 Just now, Lars Fosdal said: Odd. They show the same for me. I have git version version 2.28.0.windows.1. You? Share this post Link to post
Mike Torrettinni 198 Posted September 17, 2021 (edited) 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 September 17, 2021 by Mike Torrettinni Share this post Link to post
Lars Fosdal 1792 Posted September 17, 2021 Edit: No problem. I do that all the time 🙂 1 Share this post Link to post
corneliusdavid 214 Posted September 17, 2021 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