Useful git commands or actions for personal use

Ignoring versioned files

To start ignoring a file

$ git update-index --assume-unchanged path/to/file.txt

To start track again

$ git update-index --no-assume-unchanged path/to/file.txt

Submodules

You can pull one or all public submodules with git using the following commands :

Pull One
git submodule update --init [PATH TO SUBMODULE]
Ex. git submodule update --init c:/wamp/www/site/subfolder

Pull All
git submodule update –init,

more coming soon..

wordpress logo

How to Change the Default Media Upload Location in WordPress 3.5+

wordpress logo

Changes to Media Uploader in WordPress 3.5 were perhaps the most significant changes in that release. Another important change was the removal of Settings ยป Miscellaneous section where there was an option to change the default upload directory and an option “check box for year/month folder organization”, in the admin end. Continue reading

mysql-logo

Updating two columns with a subquery in MySQL

mysql-logo

Sometimes you wanted to update columns of one MySQL table by quering another MySQL table and getting a column value from the later table. For example you have a ‘students’ table and you wanted to create a new field ‘totalMarks’ in it and wanted to fill or update by taking sum of the ‘marks’ field from another table named ‘marks’. Here comes the use of subquery to update column. Continue reading