Welcome to the world of git

Well, now I’am using git about 2 years as my favourite Source Code Management (SCM). In this time I have collected some links that may help beginners to get into the world of git and Distributed Version Control System (DVCS).

As apparent from the title the links will mainly cover topics referring to git, but I will not let mercurial unmentioned. Mercurial is also a DVCS which features are comparable to git. It’s no loss to take a closer look at it, too.

Of course, there is the homepage of git with plenty of useful stuff – including git itself, but I think a good starting point to get familiar with the workflow off a DVCS and certainly especially git
is GIT±IMMERSION. It shows in a nice step by step tutorial the common usage of git. As reference for the several git commands it is worthwhile to look at GIT Reference. Another useful page which arranges tips by topics is git ready. Last but not least there is a wonderful free book call Pro Git available online. Additional the german podcast named Chaos Radio Express has a episode „Verteilte Versionskontrollsysteme“ about DVCS and the in parts funny tech talk from Linus Torvalds.

Linus Tovarlds Tech Talk: on git at 08:30

If you actually like cvs – you shouldn’t be here. You should be in some mental institution or somewhere else.

Some more advanced is the a-successful-git-branching-model by Vincent Driessen. This model describes a way to manage releases of a software with a branching strategy. The project gitflow on github extends git with some scripts, which simplifies to follow the model. By the way github, bitbucket and gitorious are some of the hosters for git repositories and useful for collaborate working, if you not want to set up your own server. I think you will see sooner or later that DVCS offer more workflows to work together as via a centralized server. Hope this short overview will help some one to get faster into the git world.

For a better overview all links in one list:


Terminal prompt with git branch

The console of Mac OS X, is just like any unix console. It’s very powerful and can simply be customized over the preferences of the terminal application and by setting environment variables like *PS1*. So here is a picture of my current terminal.

As mentioned before, it is a combination of preferences and some variables. So here is my current setup a bit more detailed.

First of all the preferences of the terminal app. Here I changed mainly the text font and color. I think the ordinary settings are self explaining. You can start by duplicating an existing configuration over an option under the gear symbol and customize it. Mine is based on the *Pro*.

If you like it, you can download the configuration of MyOrangeTerminal.

To activate the new configuration for every new window, go to the *Startup* tab and select it under *On startup, open*.

The second is the environment variable *PS1* which should be specified in the file *~/.profile*, which will be automatically executed on each start. This definition includes a nice behaviour in interaction with git. As you may have seen in the first picture it shows the current branch of the git repository, if you in one. Crucial is that you have git installed and included the git *bash completion* which comes along with the git installer for Mac OS X.

More information about the meaning of the components in the *PS1* definition can be found in the article prompt magic. It mainly describes the colours and available variables that can be used in the *PS1* environment variable.