title: How can I add hooks to gitlab?
body: <p>I setup a new Gitlab on CentOs on <code>/opt/gitlab-6.9.2-0/apps/gitlab/</code> and created a new repository under continuous-delivery group. The full path is <code>/opt/gitlab-6.9.2-0/apps/gitlab/gitlab-satellites/continuous-delivery/cd-test
  </code>. There is only one file under this path which is README.txt. </p>
  
  <p>What I try to achieve is to create a new file when somebody pushes changes to the server. Below are what I have done on the server:</p>
  
  <ol>
  <li>Create <code>post-update</code> and <code>update</code> files under <code>.git/hooks/' each file creates a new file using</code>echo "text" >> file_name`</li>
  <li>chmod them to 775.</li>
  </ol>
  
  <p>When I push changes from my local to the server, there is no file being created. So, I would like to know what I have to do to fix this problem.</p>
  
  <p><strong>Update 1</strong></p>
  
  <p>I added <code>post-receive</code> and <code>post-update</code> to <code>repositories</code> path as <a href="https://stackoverflow.com/a/24155063/53261">VonC suggested</a></p>
  
  <pre><code>[root@git-cd hooks]# pwd
  /opt/gitlab-6.9.2-0/apps/gitlab/repositories/continuous-delivery/cd-test.git/hooks
  [root@git-cd hooks]# ll
  total 48
  -rwxrwxr-x. 1 git git  452 Jun 10 06:01 applypatch-msg.sample
  -rwxrwxr-x. 1 git git  896 Jun 10 06:01 commit-msg.sample
  -rwxrwxr-x. 1 git git   44 Jun 11 00:37 post-receive
  -rwxrwxr-x. 1 git git   41 Jun 11 00:38 post-update
  -rwxrwxr-x. 1 git git  189 Jun 10 06:01 post-update.sample
  -rwxrwxr-x. 1 git git  398 Jun 10 06:01 pre-applypatch.sample
  -rwxrwxr-x. 1 git git 1642 Jun 10 06:01 pre-commit.sample
  -rwxrwxr-x. 1 git git 1281 Jun 10 06:01 prepare-commit-msg.sample
  -rwxrwxr-x. 1 git git 1352 Jun 10 06:01 pre-push.sample
  -rwxrwxr-x. 1 git git 4972 Jun 10 06:01 pre-rebase.sample
  lrwxrwxrwx. 1 git git   57 Jun 10 06:01 update -&gt; /opt/gitlab-6.9.2-0/apps/gitlab/gitlab-shell/hooks/update
  -rwxrwxr-x. 1 git git 3611 Jun 10 06:01 update.sample
  </code></pre>
  
  <p>Both file contains a script that adds a new line to an existing file, <code>"post-receive-2" &gt;&gt; /var/log/hooks_test.log</code>. then pushed changes from my local machine to the server. But it still doesn't append the text.</p>
  
  <p><strong>Update 2</strong></p>
  
  <p>Script in post-receive was wrong, it didn't have echo. After I added echo (<code>echo "post-receive-2" &gt;&gt; /var/log/hooks_test.log</code> then it works as expected!</p>