title: Executing git commands via PHP
body: <p>How can git commands like <code>git add .</code> and <code>git commit -m</code> be executed using php?</p>
  
  <p>It is for a project that creates a centralized repository facility for maintaining academic projects.</p>
  
  <p>exec() didn't seem to work.</p>
  
  <pre><code>&lt;?php
  $path = "/var/www/repos/$_POST[project]"; 
  $a='';
  chdir($path);
  exec("git add .");  
  exec("git commit -m'message'");
  echo "&lt;h3 align = center&gt; Succesfully commited all the files.&lt;/h3&gt;";
  ?&gt;
  </code></pre>