12

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 ?

2

1 Answer 1

14

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.