title: automatic pull on production server after push to BitBucket
body: <p>I develop my code locally, commit it to my local repsoitory and then push it to my Bitbucket server. After that I have to login via ssh to my production server
  like this:</p>
  
  <pre><code>ssh my-server@my-host.de
  pass: very-secure-passs
  cd www/myPage
  cd git pull origin master
  pass: very-secure-pass 
  </code></pre>
  
  <p>I would like to avoid login to my production server and let him pull automatically. </p>
  
  <p>I want to have 3 repositories (local, BitBucket and production Server), so I cant use this solution: <a href="https://stackoverflow.com/questions/15569581/do-an-automatic-pull-request-after-pushing-to-server">Do an automatic pull request after pushing to server</a></p>
  
  <p>I found this question <a href="https://stackoverflow.com/questions/19505509/a-hook-that-let-pull-from-vps-when-i-push-to-bitbucket?noredirect=1&amp;lq=1">A hook that let `pull` from VPS when I `push` to Bitbucket</a> which is exactly what I want, but it is from 2013 and the answer is outdated since BitBucket has changed since then. </p>
  
  <p>I found here <a href="https://community.atlassian.com/t5/Answers-Developer-Questions/How-can-I-deploy-my-bitbucket-repo-to-my-production-server/qaq-p/565348" rel="nofollow noreferrer">https://community.atlassian.com/t5/Answers-Developer-Questions/How-can-I-deploy-my-bitbucket-repo-to-my-production-server/qaq-p/565348</a> that someone suggested to use a free Plugin called <a href="https://marketplace.atlassian.com/plugins/de.aeffle.stash.plugin.stash-http-get-post-receive-hook/server/overview?_ga=2.53649256.159333475.1501838670-1388541048.1497602697" rel="nofollow noreferrer">HTTP-Request Hook for Bitbucket Server</a></p>
  
  <blockquote>
    <p>set up an automated "Pull": Each time you do a push to your central
    repository, your production machine is notified and pulls the
    repository on notification. Bitbucket Server offers serval plugins to
    support the notification process - the one I use is Http Request Post
    Receive Hook: each time a push is made, a configured URL is contacted,
    submitting some info. On my production machine I have set up a little
    web server, waiting for this HTTP-Request. On receiving the
    HTPP-Request I evaluate the given parameters and perform an action
    (for example: pulling the repository  ...)</p>
  </blockquote>
  
  <p>Now my questions are:</p>
  
  <ol>
  <li><p>Is it possible to use a <a href="https://confluence.atlassian.com/bitbucket/manage-webhooks-735643732.html" rel="nofollow noreferrer">Webhook</a> instead of the <em>HTTP-Request
  Hook Plugin</em>? </p></li>
  <li><p>How should the file on my production server look like so that it will do a pull request when it receives a HTTP-Request? I would be interested in a basic example in PHP.</p></li>
  </ol>