Blog

Resync git repo with new gitignore file

After adding .gitignore file use following commands [php] git rm -r –cached . git add . git commit -m “.gitignore is now working” [/php] Make sure to commit first your changes you want to keep. The –cached option will keep your files untouched on your disk though. Other more solution: git rm –cached `git ls-files …

Setting up new hostname with WordPress database

For setting up new hostname with WordPress database is required while moving site to new hostname. For this following SQL commands. In following example we are moving site with hostname dev.example.com to hostname www.example.com. [php] UPDATE wp_options SET option_value = REPLACE(option_value,’http://dev.example.com’,’http://www.example.com’); UPDATE wp_postmeta SET meta_value = REPLACE(meta_value,’http://dev.example.com’,’http://www.example.com’); UPDATE wp_posts SET guid = REPLACE(guid,’http://dev.example.com’,’http://www.example.com’); [/php]