1

I have a folder (which contains some files) on my dev machine and I do a git rm -r folder which marks the files/folder for removal. Then I git commit them and git push them.

When I get to my production server (which already has the files I removed from my dev machine) and I git pull, the files aren't deleted.

If I then go and manually remove the folder, git status doesn't tell me about the files that are now missing.

Somehow git rm is stopping git from tracking the files, but the push - pull scenario isn't causing them to behave as expected. Reading this makes be believe it should work just as I expect, but that isn't the case and I've tested it twice now, just trying to figure out what is going on.

What am I missing?

============= Edit ==============

Both dev and production are at commit 4bdd8627fdf22dab58d6e1de6ec6e6fc15d1ff5a

And I was pulling from master to master and the files in question have been in for numerous revisions (weeks).

Community
  • 1
  • 1
boatcoder
  • 17,525
  • 18
  • 114
  • 178
  • 1
    Are both the repository on your dev machine and the production server definitely at the same commit? (i.e. is the output of `git show` in both the same?) Were those files in your production repository definitely tracked in git in the commit it was at before you pulled? (i.e. are they listed in `git ls-tree -r HEAD@{1}`?) – Mark Longair Aug 23 '11 at 11:39

2 Answers2

1

That's definitely how it works. I've done it several times in the last few days. I'm guessing there is some intervening step you've left out inadvertently. Maybe they were previously deleted on the production server and someone restored them manually. Maybe they've been modified on the production server, even something seemingly innocuous like a backup restore or a permission change. Maybe you have a non-standard config setting. Without knowing the full history and the full sequence of commands you used, it's difficult to say. Does it work if you do a git reset --hard to the commit before the deletion and try the pull again?

Karl Bielefeldt
  • 47,314
  • 10
  • 60
  • 94
0

did you merged the remotely pushed version at the production server? see http://www.kernel.org/pub/software/scm/git/docs/everyday.html for quick reference.

shr
  • 525
  • 4
  • 7