Archive for July, 2011

Getting Started with Git

Below are some helpful links and tips for getting started with the Git version control system.

Git is rapidly becoming one of the most widely used version control systems is use today. Git is especially is open source projects as it allows for rapid merging: a feature not found in most version control systems. Git is also compact and FAST.

If you’re a developer, I encourage you to write open source software as a means of deliberate practice. Using Git in the context of open source will really help other contribute and use your work. I recommend specifically. Even professionally, I think that Git’s market share will continue to rise and be more prevalent in the workplace.

After using subversion for years, I dropped it in favour of Git. And below are a few notes that I learned along the way that may make it easier for you to get started. I hope you find using as fun as I do.


Here’s an excellent intro video. You should probably watch this first. There are two parts.

Here’s a nice, short book on how GIT works. You may want to come back to this after you’ve played with the commands for a couple of days. But I do recommend coming back to it. It has lot of explanations that show how git works. I personally read this first. After reading it, I had a great grasp of the concepts which made it easier to memorize the commands.

//see my git links on my delicious account (note: there are 3 pages; some of the more useful ones are older links; the newer links are more advanced items, so you may want to skip them for now)

//Install Git on Ubuntu
sudo apt-get install git-core


Finding the Usage

//Run: git <command> –help to see usage on that command
//eg. git push –help

Some Common Commands

git clone -o github_remote

git pull github_remote

git push github_remote github_branch_master

git push –all github_remote

git status

git commit -a -m “Fixed error with homepage not displaying the correct timezone.”

git add -i


//warning: destructive (like an svn revert); know what you’re doing first with this.

git reset –hard master

//add this bash alias to your ~/.bashrc file to be able to recursively add empty directories to a repository

alias git_add_empty_dirs=’find . \( -type d -empty \) -and \( -not -regex ./\.git.* \) -exec touch {}/.gitignore \;’

//turns on the shell colors for all working copies

git config –global color.ui always

//makes git status = git st

git config –global status

//create an alias to easily recursively update the submodules within a project

git config –global alias.subup “submodule update –init –recursive”

More Useful Git Resources

For people who have used SVN:

A Simple Workflow for using GIT in small teams

Also, the git official website has a lot of resources…

Here’s a great article on rebasing:


Create your own linux/mysql/php development box for Windows or Mac OS X

Download iso of ubuntu server edition 11
Download VirtualBox

Install VirtualBox
Create a new VM with 1000mb ram and 20GB of storage
	- bridge the network connection
	- default install (enable openssh server)
$ sudo su -
$ visudo
$ vim /etc/network/interfaces
	auto eth0
	iface eth0 inet static

$ /etc/init.d/networking restart
$ ifconfig
$ ping  //confirms internet connectivity
$ apt-get update  //update package manager sources
$ apt-get install mysql-server  //install mysql
$ apt-get install apache2
$ apt-get install php5
$ php -v  //confirm php 5.3.5
$ apt-get install samba  //install samba
$ vim /etc/samba/smb.conf
	- enable (uncomment) [homes]
	- read only = no
	- create mask = 0775
	- directory mask = 0775
$ sudo smbpasswd myusername
$ /etc/init.d/smbd restart //restart samba service to apply changes
	- should be able to connect to your smb share via windows or mac (
$ apt-get install git-core