I have a sha lets say "abcdefghijk" . I want to find the exact branch name from where the commit came from . I tried looking for other answers but most of them have some iterations or use command line , the restriction I have is I need to use only GIT API (Rest) to retrieve the branch name .
I tried looking for search API but it gives me commit details and the commit details doesn't contain branch name . Even if I get the pull request from where the commit is coming from would also be helpful . So using GIT API I want to check either the branch name or the pull request from where the commit is coming from .
Any help here is appreciated .
Reason : Why I want to know branch name
So let's say the manifest created for deployment is created from master branch . So let's say there are 2 PR's from a feature branch which was merged to the master branch .
master_branch
--PR1 (From Feature Branch which has 1 commit)
--PR2 (From Feature Branch which has 2 commit)
Now those commits will appear in Master Branch .
Now Feature Branch in PR1 had 1 commit made 3 days before deployment . Feature branch in PR 2 has 1 commit made 3 days before and second commit made 11 days before deployment .
I want to know from which branch those commits came from . Reason is I want to know which branch commits took max time to make it to the master branch (ie: Point out the fault branch which took max time to make it to master after first commit ) .