How to get git informations with Java?

Is there any way to retrieve git information programmatically using Java? I would like to know:

  1. All branches in current repository-directory
  2. Current branch of my working project
  3. All committed informations

In addition can I execute git processes (commit, rollback, checkout, delete branch, etc.) using Java?

  • What is the current way to remove a git submodule?
  • Git tab completion not working in zsh on mac
  • Sync local branch with remote branch egit
  • How to combine two separate unrelated Git repositories into one with single history timeline
  • Why should I avoid creating gitignore and README on GitHub
  • How to stop git from making files non-executable on cygwin?
  • I really do appreciate any suggestions .. Thanks

  • Using Git, how can I log all commits that are merge commits between two specific branches?
  • Fitnesse has page properties removed when checking out from git
  • Removing entry with null SHA1, and finding corresponding commit
  • Git cherry combined with git show
  • getting git branches of a certain age
  • Why do GitHub HTTPS schemes always ask for my password?
  • 2 Solutions collect form web for “How to get git informations with Java?”

    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.

    Git Baby is a git and github fan, let's start git clone.