How To Rename a Branch in Git Locally and Remotely

Author: , January 31st, 2018

Rename the old branch locally: git branch -m oldBranch newBranch Delete the old branch remotely: git push origin :oldBranch Push up the new branch, and make the local branch track with the new remote branch: git push –set-upstream origin newBranch

How To Move A File Safely In PHP:

Author: , March 3rd, 2012

Safely move a file in PHP: 1 2 3 if (copy("/your/source/file","/your/destination/newfile")) {   unlink("/your/source/file"); } if (copy(“/your/source/file”,”/your/destination/newfile”)) { unlink(“/your/source/file”); }

How To Rename A MySQL Database

Author: , December 3rd, 2011

YMMV… 1 2 mysql –batch -u root -p -e "create database yourDataBaseBackup; SELECT CONCAT(‘RENAME TABLE ‘,table_schema,’.’,table_name,’ TO ‘,’yourDataBaseBackup.’,table_name,’;’) FROM information_schema.TABLES WHERE table_schema LIKE ‘yourDataBase’;" > backup.sql mysql -u root -p < backup.sql mysql –batch -u root -p -e “create database yourDataBaseBackup; SELECT CONCAT(‘RENAME TABLE ‘,table_schema,’.’,table_name,’ TO ‘,’yourDataBaseBackup.’,table_name,’;’) FROM information_schema.TABLES WHERE table_schema LIKE ‘yourDataBase’;” > backup.sql […]