title: Why does `git pull` fail on my webserver?
body: <p>I use git to pull changes os a site's code base. The changes inside files and deletion of files works, however, when I add new files or directories (not empty ones) to the repo, it wont get pulled locally to the webserver, when pulling no error message is displayed but when checking for that file, it is not there. Online at the bitbucket repo it is shown.</p>
  
  <p>Tried to delete the local git repo and clone it again, this way I get all the files from origin, but the problem persist when doing a pull for newly added file. It shows as if its pulled:</p>
  
  <pre><code>...
     18bb8ac..c9c1e40  master     -&gt; origin/master
  Updating 18bb8ac..c9c1e40
  Fast-forward
   config/plugins/test1.txt   | 22 ++++++++++++++++++++++
   config/plugins/testing.txt | 22 ++++++++++++++++++++++
   2 files changed, 44 insertions(+)
   create mode 100644 config/plugins/test1.txt
   create mode 100644 config/plugins/testing.txt
  </code></pre>
  
  <p>But when checking (<code>ls -la config/plugins/</code>), the new files are not there. Even if I try the pull with <code>sudo git pull</code>.</p>
  
  <p>I tried hard but after this I couldn't make the file appear unless I removed the whole local repo and cloned it again. No hard reset, nothing seems to help.</p>
  
  <p>What I did check:</p>
  
  <ul>
  <li>Ensured there are actually saved changes on the file in question.</li>
  <li>Ensured the file doesn't meet my exclude rules in .gitignore and .git/info/exclude</li>
  <li>Ensured not trying to add an empty folder. Git won't track those.</li>
  </ul>
  
  <p>My permission settings for this repo on the webserver was based on:
  <a href="https://www.agix.com.au/git-a-walk-through-for-sysadmins/" rel="nofollow noreferrer">https://www.agix.com.au/git-a-walk-through-for-sysadmins/</a></p>
  
  <p>So it is:</p>
  
  <pre><code>sudo chown apache:apache -R /var/www/html/sites/mysite
  cd /var/www/html/sites/mysite
  # File permissions, recursive
  sudo find . -type f -exec chmod 0644 {} \;
  # Dir permissions, recursive
  sudo find . -type d -exec chmod 0755 {} \;
  sudo setfacl -R -b -m user:root:rwx -m d:user:root:rwx -m group:developers:rwx -m d:group:developers:rwx -m group:apache:rx -m d:user:apache:rx /var/www/html/sites/mysite
  </code></pre>
  
  <p>My user in the developer's group. </p>
  
  <p>Here is my <a href="https://drive.google.com/open?id=1HgM_1lc04VwHUXuCoHEYdPFRs9ThGO1Y" rel="nofollow noreferrer">.git</a> directory from the server.</p>
  
  <p>I'm using CentOS7 and git 2.16.3.</p>