|Retrieve User Name and Email Address from the Git Repo [message #1853258]
||Fri, 24 June 2022 10:55
| Pratap Meka
Registered: June 2022
I want to retrieve the User Name & Email Address for a given Git Repository using Jgit API.
Example Code snippet:
Git gitRepo = Git.open(new File("C:\\TestRepo\\"));
PersonIdent personIdent = new PersonIdent(gitRepo.getRepository());
String repoUserName = personIdent.getName();
String repoUserEmailAddr = personIdent.getEmailAddress();
When I execute this code, I always get the Email Address of the Organization of the System which I am logged in. I think it always reads the git config on the local machine and fetches the User Name and Email Address.
So is there any possibility (Jgit API/ REST API), where I can get the actual User Name and the Email Address of the user of the Remote GitHub Repository?
Any help regards to this is highly appreciated.
Thanks & Regards,
[Updated on: Fri, 24 June 2022 11:09]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.04973 seconds