I was able to run the git commands via shell script. But is there any possible mean by which I can call each git statement i.e git show <SHA>:<file> directly from java ?
-
Refer this. I believe this might help you. Thanks, MMukul Kumar Chaundhyan– Mukul Kumar Chaundhyan2017-03-05 03:07:21 +00:00Commented Mar 5, 2017 at 3:07
-
Similar: Calling git from Java with command lineBasil Bourque– Basil Bourque2025-04-02 08:00:24 +00:00Commented Apr 2 at 8:00
Add a comment
|
1 Answer
Process API
Use the Process class in the Process API bundled with Java to execute git commands directly.
JGit
Or, you could use the JGit library, an open-source Java implementation of git. See this guide.