I almost always forget to “git rm <file>” before deleting it. Here’s a quick way to pull deleted files from a Git repository and remove them:
git rm $(git ls-files --deleted)
Like many Linux utilities not included on Mac OS X, Homebrew can provide logrotate to more effectively manage large log files. Setup:
brew install logrotate
- Once installation is complete, create a configuration file for logrotate. I chose to use the same configuration defined here: http://overstimulate.com/articles/logrotate-rails-passenger and named the file “logrotate.conf”.
- We can now kick logrotate in to gear:
/usr/loca/sbin/logrotate -f -s logrotate.status logrotate.conf
Note that in the above, I defined explicitly where to stick the logrotate status file so that it is owned by the current user and not reliant on sudo, etc.