I'm working on cleaning up my local dev copy. I have a WordPress installation on the server, but I don't need any of the WP core files in the repo. I added wp-*.php to the local .gitignore, and removed some files using git rm --cached wp-*.php. I committed the changes, and pushed to the central repo.
On the production server, I went to pull the changes with git pull remote master and it deleted the wp-*.php files from the server.
What is the correct way to accomplish this, without a git pull deleting files from the production server.
It will only remove them once (because you told Git to remove the files from its tracking). You can then manually add them back on the server side, and Git won't remove them again, because it will no longer be tracking them after the first removal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With