Quick git workflow for small teams


Here is a simple and straightforward way of using git in small teams. I have tried different approaches and think this works well for teams up to a size of 5 people. Beyond that, you may incorporate some more sophistication in the workflow, but that can be in a different post.

For this post, assume that the team is set up with github as the remote from where everyone cloned. I won’t go into the details on how to clone from github and get setup with remotes etc. If you follow simple steps, this is a very standard configuration. However, if you do need help with this, try one of these useful books.

Master should never be broken

The master is the branch that is never broken. It is the branch that is deployed to the production site. You should always have full confidence that deploying the master doesn’t break anything.

git workflow small teams

The workflow

Before you start working on a feature do this:

git checkout -b my-awesome-feature

As you make your changes you can commit them

git commit -m "made an awesome change"

To back things up, also just push your branch up to your remote. The following command will automatically create a branch called “my-awesome-feature” on your remote and your commits will be available there cleanly in a separate branch

git push origin

To make sure the world hasn’t changed too much since you started working on this feature, you want to grab the latest from master and make sure your changes are still valid on top of it. If you rebase often, you will have less surprises when you merge.

git rebase master

Happy with what you have? create a pull request. Go to Github, find the repo, look for your branch and select “create pull request”. This way someone on your team can review your changes and give you a quick code review. When they are happy with your work, they can press the “single green button” to merge that into master.

Now, master has the latest code, so you can delete your branch safely.

git branch -d my-awesome-feature
git push origin --delete my-awesome-feature

Deploy the master to your production server using whatever deploy method you like. It could be heroku, or your own server with shell scripts, build or CI system or whatever floats your boat.

How to install PhantomJs on a CentOS server


I was playing around with using a server to run end to end scenario testing using PhantomJs (new to it, check out some useful books here). I like that PhantomJs has minimal requirements. However, I did have to install a couple of libraries that I didn’t find clear documentation for. So to benefit anyone who might be trying to do this, here are my steps:

Download Phantom

[samh@do ~]$ curl -O https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-i686.tar.bz2
 % Total % Received % Xferd Average Speed Time Time Time Current
 Dload Upload Total Spent Left Speed
100 13.0M 100 13.0M 0 0 2908k 0 0:00:04 0:00:04 --:--:-- 3402k

Extract directory

[samh@do ~]$ tar xvf phantomjs-1.9.1-linux-i686.tar.bz2

Copy binary to bin folder (note you may need to use sudo if you are not logged in with root priveleges)

[samh@do ~]$ cp phantomjs-1.9.1-linux-i686/bin/phantomjs /usr/local/bin

You will notice that this is not enough to run Phantom and you will encounter this error:

[samh@do ~]$ phantomjs hello.js
phantomjs: error while loading shared libraries: libfreetype.so.6: cannot open shared object file: No such file or directory

Here is the step to eliminate it:

[samh@do ~]$ sudo yum install freetype

Then you will see another error:

[samh@do ~]$ phantomjs hello.js
phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory

And here’s how to eliminate it:

[samh@do ~]$ sudo yum install fontconfig

This is it. Everything should work now:

[samh@do ~]$ phantomjs hello.js
Hello, world!

… I love you … Please Repeat?


Me: What time is it?
She: It’s 10:48 pm

Me: What day is it?
She: The date is Tuesday, December fifth two thousand and six.

Me: When is my next appointment?
She: Tomorrow at 4:30 pm in 2260 USB

Me: Play music
She: Do you want to listen by genre, album, artist or anything?
Me: Artist
She: Do you want to listen to U2, Phil Collins, Collective Soul, …
Me (interrupting): U2
She: Playing U2 … (Windows Media Player opens up and Zooropa starts)

Me: I think I am falling in love with you!
She: Please repeat!
Me: I said I think I am falling in love with you!
She: Please repeat!
End of converstation.

I had the above conversation with my phone after installing Microsoft Voice Command on it. It really is one of the most amazing voice command softwares I have seen. It’s a good example of the serious research microsoft has been doing in “speaker-independant voice recognition”. You do not need to train this software, just speak to it in natural english and it works fine (if she can understand my Indian accent, I think she is pretty good).

Oh yes, I call the software a “she”. I just can not bring myself to calling her an “it”. Examples of other things I can ask her to do:

“What is my schedule for today”, “Change profile to silent”, “Turn off all reminders”, “call john at work”, “start calculator” etc. She even reads out the contents of emails that I receive. This software is a good reminder of the fact that we really are getting somewhere with digital assistant technology. I would really recommend watching the demo video to get a sense of what it really feels like.