Git alias to delete all local branches

In my current project we have to use TFS as our “remote” repo. Locally I use git-tfs so that I can still be productive and do, ya know, work. Jimmy has a post describing in details the workflow that we use here but the TL;DR: version is:  All work is done on local topic branches; You push to TFS from the topic branch; TFS, after running the build/tests, will commit the changes that were pushed; You pull the commited changes to master. You create a new topic branch, rinse and repeat.

I’ve been working with this workflow for more than an year and it’s working great. It has one side effect, though. It can leave tons of non-merged branches, if you don’t delete the topic branch after you pushed. So, once in a while it is time for some branching cleanup.

At first I was doing the cleanup manually, but I’m really lazy and I’d rather tell the computer to do the work for me. So, here is my git alias to  delete all local topic branches except “master”:

dab = !git checkout master && git branch | grep -v "master" | xargs git branch -D

Now, every time I want to do some branch cleanup I simply do git dab and all the junk branches are gone.

 

Installing Less.css on OSX Lion

Today I was following the instructions to upgrade to the latest version of the Twitter Bootstrap.

It’s pretty straight forward. It is really awesome, actually. All you have to do is: Open the terminal, pull the changes, run make.

But, Twitter Bootstrap uses Less.css, so one of the steps of the update script is to compile the .less files into .css. I didn’t have less compiler installed on my MacBook Pro, so instead of successfully upgrading the Bootstrap, I got this on my terminal:

lessc: command not found

So, my first reaction was to try installing less using Homebrew:

Homebrew doesn't have a formula for less.css

Dang it. There is not Homebrew formula for Less. I’ll have to open my browser to install a software, damn it. So I headed to Less.css website and saw that the easiest way to install the compiler to be used on the server side is via the node package manager, npm. Then I did: npm install less

npm installed less

All right, now let’s try running make again.

less not found again

Ok. It’s still not found. Maybe installing it globally will solve the problem: npm install less --global

npm install less with global option

All right, now that less is installed globally, let’s try running make again to update Twitter Bootstrap.

Bootstrap upgraded succesfully. Yay!

Yay, it worked. The --global option did the trick.

HotFix for Checkdisk hanging at 1 sec

I have a Dell Studio XPS 1640 running Windows 7 Home Premium x64.

Yesterday it crashed (sigh) and when I rebooted the check disk was triggered. To my, not pleasant, surprise, Check Disk hanged at 1 sec left on the countdown for pressing a key to skip the disk check. Doing a hard reboot several times I was able to start windows again.

Well, after some googling I found the HOTFIX KB 975778 that solved the issue like a charm for me.