title: Calling git from Java with command line
body: <p>When trying to call a git command, that is executed properly in normal command line, from Java, I get an strange result: it outputs nothing. </p>
  
  <p>For example, if I try to run this:</p>
  
  <pre><code>public class GitTest {
      public static void main(String args[]) throws IOException{
          String command = "git clone http://git-wip-us.apache.org/repos/asf/accumulo.git";
          Process p = Runtime.getRuntime().exec(command);
          BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
          String line; 
          String text = command + "\n";
          System.out.println(text);
          while ((line = input.readLine()) != null) {
              text += line;
              System.out.println("Line: " + line);
          }
      }
  }
  </code></pre>
  
  <p>I get no output (except for the command, which is printed before). It seems like git is still downloading something, but does not tell it to me. Maybe it would output everything after it's completed (so the normal git call outputs, how much is ready, and changes this line everytime - maybe because of this the BufferedReader can not read a finished line and therefore not output it).</p>
  
  <p>Is there any workaround, to get this working?</p>