title: Using Git for website development
body: <p>I'm new with using Git on website development and need a suggestion.
  I have website example.com (production) and it's clone dev.example.com (development)
  Currently I've created 2 git repos for each of them  and can commit and push changes to each of them separately. 
  I'm using this solution for each of them:</p>
  
  <h3>create bare repo</h3>
  
  <pre><code>cd /home/git/example.com.git
  git init --bare
  </code></pre>
  
  <h3>My config</h3>
  
  <pre><code>[core]
      repositoryformatversion = 0
      filemode = true
      bare = false
      worktree = /var/www/example.com/htdocs/
  [receive]
      denycurrentbranch = ignore
  </code></pre>
  
  <p>File: hooks/post-receive</p>
  
  <pre><code>#!/bin/sh
  git checkout -f
  </code></pre>
  
  <h3>and make it executable</h3>
  
  <pre><code>chmod +x hooks/post-receive
  </code></pre>
  
  <h3>push files into repo</h3>
  
  <pre><code>cd /var/www/example.com/htdocs.default
  git init
  git add .
  git commit -a -m "Initial Commit"
  git remote add example.com git@example.com:example.com.git
  git push example.com +master:refs/heads/master
  </code></pre>
  
  <p>and the same for my dev site. So I have 2 different web sites, 2 git repos, and as developer I have to merge all on my laptop and push to git dev repo, then check it in browser and then push it to my production repo and check it on main web site.</p>
  
  <p>Is there a solution to use one git repository (bare?) and have two branches in it: production and development, so I can:</p>
  
  <ol>
  <li>clone dev on my laptop</li>
  <li>then make changes</li>
  <li>push it to remote dev</li>
  <li>check in browser that it's ok (when pushing to dev, it should appear
  in  (/var/www/dev.example.com/htdocs)</li>
  <li>Push the same changes from remote dev to remote production so they'l
  appear in production dir (/var/www/example.com/htdocs)</li>
  </ol>
  
  <p>How to configure git (what configs, commands I need) so it can do so and the main question how to let him know that I'm satisfied with how dev.example.com looks in my browser and he can push/merge/commit this changes from dev to production?
  Thanks</p>