Thursday, September 8, 2016

Unlink of file '.pack' failed. Should I try again? (y/n) - git issue

Sometime we get following error while performing Unlink of file '.git/objects/pack/pack-06d70e51d1b5fd449965cdbded452063b51f95aa.pack' failed. Should I try again? (y/n)

This means the file is open in one of the editors (say eclipse or jdeveloper etc.). Close the editor and perform git operation, say "git pull". It should work.

Don't forget to reopen the editor and keep working. :)

Thursday, September 1, 2016

Get yesterday's date in UNIX

You can get previous date using below command :

$ date --date="1 days ago"

Assigning a format
$ date --date="1 days ago" '+%Y%m%d'

Assigning to a variable
YESTERDAY=$(date --date="1 days ago" '+%Y%m%d')