title: github error: insufficient permission for adding an object to repository database
body: <p>I used to be able to do, from my App folder:</p>
  
  <pre><code>git add .
  git commit -m "commit details"
  git push
  </code></pre>
  
  <p>and the latest version of my app on my local machine would be backed up on in my master repo, on github.</p>
  
  <p>Now, when I get as far as just the <code>git add .</code> command, I get:</p>
  
  <pre><code>mycompaq@ubuntu:~/myapp$ git add .
  error: insufficient permission for adding an object to repository database .git/objects
  
  error: app/views/reviews/update.js.erb: failed to insert into database
  error: unable to index file app/views/reviews/update.js.erb
  fatal: updating files failed
  mycompaq@ubuntu:~/myapp$ 
  </code></pre>
  
  <p>I read in a message on Stackoverflow the way to overcome a similar problem was with:</p>
  
  <pre><code>chown -R user:user /project/directory
  </code></pre>
  
  <p>But seeing as I got in a <em>whole load of trouble</em> in the first place by running commands I wasn't sure about, I want to know if this is the command for me. What does it do? Can it be undone?  </p>
  
  <p>What should the exact syntax be, if the user is 'Christophe', and the folder where my Rails app is stored is called 'myapp'. I mean should it be </p>
  
  <pre><code>chown -R user:christophe /myapp/app/views/reviews/update.js.erb
  </code></pre>
  
  <p>Sorry for all the questions.</p>