In GitKraken, we report from one branch to another commits with the same reference.
Problem : It's difficult to detect in which branch the commit is located if we do a search with CTRL+F.
Is there a way to know the name of the branch from a commit?
We have 7 commits with the same reference
If I select one of them, I'm positioned on a commit.
From this view, it is impossible for me to know the name of the branch.
In short: No.
As @RomainValeri said in his comment: a commit does not "belong" to any branch. A branch is nothing more than a pointer to a commit. There may be a hundred branches from which a commit is reachable, or there may be none.
The git command git branch --contains <commit>
, suggested by @MohammadAnsari, will show you a list of all branches from which the commit is reachable.
As to GitKraken: There is no immediate solution for your problem. If the commit is further down the graph, it's hard to tell to which strain of ancestor commits it leads. Also, there is no GitKraken command that does what git branch --contains <commit>
does (or none I know of).
Maybe you should overthink your wokflow of having commits with the same name, or rethink your branching strategy. Do you have several long running branches? If all branches would converge against a single master
, the question would be trivial.