Here is my problem: I want to create a git log file staying outside the repository folder and save it as TestfromShell.txt
.
I have git command
git -C /var/git/plexus.git log > Test.txt
for linux machine. I want to execute this command from Java, but every time I execute this command from Java, it says:
Command to be executed :git -C /var/git/plexus.git log > Test.txt
Error:
fatal: ambiguous argument '>': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Java code:
command="git -C /var/git/plexus.git log > Test.txt";
p = Runtime.getRuntime().exec(command);