Reputation: 18107
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).
Upvotes: 1
Views: 659
Reputation: 49028
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?
Upvotes: 1
Reputation: 525
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.
Upvotes: 0