title: How to upload files,create folder into repo using api
body: <p>Hi i m using <a href="http://developer.github.com/v3/git/" rel="nofollow">GitHub v3</a> and i want to add new binery file in repo .by using <a href="https://github.com/KnpLabs/php-github-api" rel="nofollow">KnpLabs php-github-api</a> i m exectly doing what says in </p>
  
  <ol>
  <li>get the current commit object</li>
  <li>retrieve the tree it points to</li>
  <li>retrieve the content of the blob object that tree has for that particular file path</li>
  <li>change the content somehow and post a new blob object with that new content, getting a blob SHA back</li>
  <li>post a new tree object with that file path pointer replaced with your new blob SHA getting a tree SHA back</li>
  </ol>
  
  <p>and soo on . but on 5 point i got an exseption </p>
  
  <pre><code>server error
  </code></pre>
  
  <p>form this code</p>
  
  <pre><code>$comit=$client-&gt;api('git')-&gt;commits()-&gt;show($userName,$reposit,'master');
  $basetree=$client-&gt;api('git')-&gt;trees()-&gt;show($userName,'appwiz',$comit['commit']    ['tree']['sha']);
  
  $newBlob=$client-&gt;api('git')-&gt;blobs()-&gt;create($userName,$reposit,array('content'=&gt; "gitapi",'encoding'=&gt;'base64'));
  
  $client-&gt;authenticate($userName,$password,Github\Client::AUTH_HTTP_PASSWORD);
  $treeData = array(
          'tree'=&gt;
          array(  array('path'=&gt;'/'
                  ,'mode'=&gt;'040000'
                  ,'type'=&gt;'tree'
                  ,'content'=&gt;'folder')
          )
  );
  </code></pre>