Note that there are some explanatory texts on larger screens.

plurals
  1. POgit pull doesn't recognize the files it "pulls"
    text
    copied!<p>In previous projects I used to use a cron job that would run "svn up" to keep a test site up to date.</p> <p>I'm trying to reproduce the same in a new project that uses git. </p> <pre><code>*/5 * * * * cd /path/to/project; git checkout .; sudo -u nonrootuser git pull &gt;/dev/null 2&gt;&gt; /path/to/project/cron.log; chgrp web . -R; </code></pre> <p>I added the initial git checkout . to see if I could solve the issue, but it persists. The issue is as follows, about once a week, I get this message:</p> <pre><code>error: Your local changes to 'path/to/aFileThatDidntExistLocally.xxx' would be overwritten by merge. Aborting. Please, commit your changes or stash them before you can merge. </code></pre> <p>But that file really didn't exist before the pull command. Its almost as if the git pull command is fetching the files, staging them, then as if struck with Alzheimer, failing to recognize having created the file, and thus aborting because the file is already there. </p> <p>Even if I delete the file, it happens again. It will also happen if I run a simple "git pull" with my root user. Also it seems to be kind of random, its happened to me about three times in the past three weeks. All the rest of the time the cron job works as expected, every 5 minutes. </p> <p>The only way I've found to get it to pull correctly again is to run "git clean -f", but its not something I want to place in my cron job because it removes all of my untracked files.</p> <p>I suspect the commits/pushes, but I don't see anything out of the ordinary. What is going on, and how can I consistently update my test site without having to remove all untracked files each time?</p> <p>(edit) Here are a copy of my .gitignore and .git/config files: <a href="http://pastebin.com/SxXbshuN" rel="nofollow">http://pastebin.com/SxXbshuN</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload