title: git push files don't get updated remotely
body: <p>A very common scenario:</p>
  
  <p>We have a bare repository.
  If the developers do <code>git push</code> from their local machine to the <code>bare</code> repo, and then another developer does <code>git pull</code> they get the local version of the application (files included) updated.</p>
  
  <p>However, from time to time, when a change is made directly (by our host or whatever) on the <code>remote working tree</code>, we end up having different file versions on our local machines, and the <code>remote working tree</code> get's always outdated!</p>
  
  <p>According to this:</p>
  
  <p><a href="https://git.wiki.kernel.org/index.php/GitFaq#non-bare" rel="nofollow">https://git.wiki.kernel.org/index.php/GitFaq#non-bare</a></p>
  
  <blockquote>
    <p>The push operation is always about propagating the repository history
    and updating the refs, and never touches the working tree files. In
    particular, if you push to update the branch that is checked out in a
    remote repository the files in the work tree will not be updated.</p>
  </blockquote>
  
  <p>I'm not sure what <code>checked out in a remote repository</code> means. I didn't make any <code>git checkout whatever</code> to switch branches using ssh remotely (if that's what that means).</p>
  
  <p>Anyway, if we do git push, no working tree files gets touched. Ok.</p>
  
  <p>So in order to solve this:</p>
  
  <blockquote>
    <p>If you are sure what you are doing, you can do a "git reset --hard" on
    the side you pushed to. Note that this WILL lose ALL changes you made
    on that side, resetting the working tree to the newest revision you
    pushed.</p>
  </blockquote>
  
  <p>"git reset --hard"</p>
  
  <p>I did this, but nothing got changed. It says:</p>
  
  <pre><code>HEAD is now at 45d948a Merge branch 'dev' of /home/blabla/private/repos/blabla_hub into dev
  </code></pre>
  
  <p>But nothing is changed.</p>
  
  <p>1) How does all developers have the working tree updated if they are only pushing and pulling trough a bare (no working tree) repository ? (Where do the files pass?) </p>
  
  <p>2) Why didn't I get the <code>remote working tree</code> updated as expected ?</p>
  
  <p>Are my questions clear? Please advice.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I'm using a dev and master branch. Both locally and remotely, apart from that, I'm using this schema:</p>
  
  <blockquote>
    <p>The key idea in this system is that the web site exists on the server
    as a pair of repositories; a bare repository alongside a conventional
    repository containing the live site. Two simple Git hooks link the
    pair, automatically pushing and pulling changes between them.</p>
    
    <p>The two repositories:</p>
  
  <pre><code>Hub is a bare repository. All other repositories will be cloned from this.
  Prime is a standard repository, the live web site is served from its working directory.
  </code></pre>
    
    <p>Using the pair of repositories is simple and flexible. Remote clones
    with ssh-access can update the live site with a simple git push to
    Hub. Any files edited directly on the server are instantly mirrored
    into Hub upon commit.</p>
  </blockquote>
  
  <p>ref. <a href="http://joemaller.com/990/a-web-focused-git-workflow/" rel="nofollow">http://joemaller.com/990/a-web-focused-git-workflow/</a></p>