1 0 Tag Archives: terminal
post icon

Completely remove a file or directory from all revisions in a git repository

I’ve accidentally added files and directories into my git repository before and forgot that I did. Then a few days later was swearing and cursing. After a pile of google searching I’ve found a couple resolutions for these problems that have and are working perfect for me.

First I take no responsibility for your actions on performing these commands. I’m not positive if you can undo these changes. You will want to maybe back up your files before trying these out.

Remove Directories

git filter-branch --tree-filter 'rm -rf vendor/plugins/someshitplugin' HEAD

Remove Files

git filter-branch -f --index-filter 'git update-index --remove public/index.html' HEAD

Then after either of those run these two commands:

git push --force --verbose --dry-run
git push --force
Leave a Comment
post icon

Better alias for Ruby on Rails script/server and TextMate mate app

Just the other day I was browsing through some railscasts from Ryan Bates and noticed he was starting his server with “ss”. It made me pissed that I hadn’t thought of doing that before, I guess because I was so comfortable cd ~/Sites/appname and script/server. So I first wrote some aliases like Ryan’s “ss”, but then thought huh, this could be better… Google to the rescue and I found this code for script/server and then that inspired me to write this code for mate appname. Pretty quick to open and boot apps!

Leave a Comment
post icon

Installing ImageMagick on Mac OS X Leopard

I recently just got the 24inch iMac and had to undergo the massive task of porting over everything from my MacBookPro. This included installing all the needed custom installs of Ruby, Rails, ImageMagick, RMagick, MySQL and configuring everything to work properly. I had the most trouble with ImageMagick, although it wasn’t that hard It still took me a bit to do. Now I hate mac ports, well I don’t hate but I don’t like how it install stuff everywhere. I like being able to control what’s being installed in a tidy fashion. So this is what I did to get ImageMagick working:

(more…)

Leave a Comment
post icon

Ten OS X Command Line Utilities you might not know about

Found a site that has some cool terminal commands. The sites called OS X Daily. My favorite command was “top” which will show you in your terminal window all your computers cpu usages and more.

Leave a Comment