title: Output GitLog with Java Processbuilder to File
body: <p>I create a Programm in Java which should automatic create a log file with gitlog and analyze this file.
  But i have a Problem with Gitlog.
  I created a Method who start <code>git log</code> in cmd and print this in a file out.</p>
  
  <p>The programm start gitlog an show this in cmd, but the new file is empty. </p>
  
  <p>How can i output this log in a file ?  </p>
  
  <p>My Method :</p>
  
  <pre><code>Path LogPath = Paths.get("C:/Users/User/Code/code1");
  
  List&lt;String&gt; cmds = Arrays.asList("cmd.exe", "/C", "start", "git", "log");
  ProcessBuilder builder = new ProcessBuilder(cmds);
  builder.directory(new File("C:/Users/User/Code/code1/git"));
  
  builder.redirectOutput(ProcessBuilder.Redirect.to( LogPath.resolve("gitlog.txt").toFile() ) );
  
  Process process = builder.start();
  </code></pre>