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 ?
If you want to use Git from within a Java program, there is a fully featured Git library called JGit. JGit is a relatively full-featured implementation of Git written natively in Java, and is widely used in the Java community.
Use Ctrl+3 (or Cmd+3) and type Git Repositories in the dialog to open the Git repositories view. This view shows you the Git repositories you can work with in Eclipse and allows you to add existing repositories to Eclipse, create or clone repositories. It also allows you to perform Git operations.
You must have Java, Eclipse, Constellation, and Git set up and working on your laptop.
You can use the Process API to execute git commands directly.
Or, you could use JGit, which is a Java implementation of git.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With