【发布时间】:2012-06-17 20:45:45
【问题描述】:
我正在尝试使用以下 Java 语法来执行 Git blame 命令:
Process process = Runtime.getRuntime().exec("/usr/bin/git blame https://github.com/git/git/alloc.c > TestGit.txt");
但是,当我在 Java 中运行代码时,它没有给出任何结果。而且,当我尝试在终端中执行它时,它只是创建了一个空的“TestGit.txt”文件,我得到了错误:fatal: Not a git repository (or any of the parent directories): .git。
【问题讨论】: