0

I have a file called "sitemap.xml" that (to my knowledge) is not part of my git repository. It is on my .gitignore list though. To test my theory, I've updated the sitemap.xml file locally and it didn't appear as changed in Tower (my git GUI client).

There is an existing "sitemap.xml" on my site though. When I push a new git commit live, the existing "sitemap.xml" file is deleted on my site. This leads me to believe "sitemap.xml" is still somehow part of my git repository.

I tried going into Terminal on my local machine and doing "git rm sitemap.xml" in the proper directory in my git repo, but there was a "pathspec" error saying it "did not match any files."

Any ideas?

Tim Jahn
  • 1,154
  • 7
  • 16
  • 29
  • What do you mean by "push a new git commit live"? Normally pushing won't make any changes to a working tree. – qqx Oct 25 '12 at 19:04
  • I'm using PHP Fog and when I push a new commit to them, it's automatically deployed live. – Tim Jahn Oct 26 '12 at 02:15

2 Answers2

0

try this: git rm sitemap.xml --cached

read the documentation here http://www.kernel.org/pub/software/scm/git/docs/git-rm.html

jonhkr
  • 600
  • 5
  • 11
0

Your question implies that sitemap.xml actually was part of your repository in the past. If the repository on your site does contain a sitemap.xml, then pushing a version without that file will cause the file to be deleted when the remote is update.

However, this will only happen once. If, after updating to a version without sitemap.xml, you put that file back then future updates will not delete it.

Greg Hewgill
  • 951,095
  • 183
  • 1,149
  • 1,285
  • Sorry, I should have mentioned that. Sitemap.xml was a part of the repository in the past but should not be presently. – Tim Jahn Oct 26 '12 at 02:15
  • Okay, so this will be a one-time problem. Update your server, put the correct `sitemap.xml` file back, and carry on. – Greg Hewgill Oct 26 '12 at 02:20
  • I've done that. The sitemap.xml that is on the server is dynamically generated, and not part of the git repository. When I push a new commit live, it seems to delete the sitemap.xml that is on the server. – Tim Jahn Oct 26 '12 at 17:12
  • Well then it's hard for me to say why that might happen. Is it possible this could have something to do with PHP Fog? (I don't know anything about that specifically.) – Greg Hewgill Oct 26 '12 at 18:36