简体   繁体   English

我如何从java运行git命令?

[英]How can i run git commands from java?

I was able to run the git commands via shell script. 我能够通过shell脚本运行git命令。 But is there any possible mean by which I can call each git statement ie git show <SHA>:<file> directly from java ? 但有没有任何可能的意思,我可以通过它直接从Java调用每个git语句,即git show <SHA>:<file>

You can use the Process API to execute git commands directly. 您可以使用Process API直接执行git命令。

Or, you could use JGit , which is a Java implementation of git. 或者,您可以使用JGit ,它是git的Java实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM