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 ?
You can use the Process API to execute git commands directly.
Or, you could use JGit, which is a Java implementation of git.