How to get git informations with Java?
Is there any way to retrieve git information programmatically using Java? I would like to know:
- All branches in current repository-directory
- Current branch of my working project
- All committed informations
In addition can I execute git processes (commit, rollback, checkout, delete branch, etc.) using Java?
I really do appreciate any suggestions .. Thanks
2 Solutions collect form web for “How to get git informations with Java?”
JGit http://eclipse.org/jgit/ is a Java API for interacting with a Git repository. I believe it is the basis of EGit which is the plug-in that integrates Eclipse to Git.
I think you can make use of shell commands within Java. Try to run a simple shell command withing Java. Then you can add more git specific commands within your program.