Tuesday 22 June 2010

How To: GIT repository on Solaris 10

Last year I did replace my SVN software repository with GIT.

Last moth I began to use GIT also at the office because I will be able to roll back the experimentations sometimes I do in my projects. The history of the Eclipse IDE isn't enough to archive the goal. GIT creates locally a full featured repository with tags and branches. Any time I may switch to a different branch, so I may work, at the same time, on the mainstream and on the experimental features.

Now I wish to improve the environment because I have to work on different workplaces and I need some help from other employees to deliver the software on time.

Since there is no free LINUX installation which I may use to place the "bare" instance of the repository I have to install the software and the data on a SUN Solaris 10 server. sunfreeware provides the GIT software with instructions and requirements. I was able to install and use GIT on our two year old Solaris 10 instance without any problem.

GIT doesn't require a lot of space: I did place the repository on a 30 GB partition, which holds also our daily backups. I like simple environments, so I did define a single UNIX user (git:git) to access and administrate the repository. GIT keeps anyway track of the user which commits a change, so I don't need to define different access permissions for each developer. Anyway it would be easy to authorize an observer: I would only need to create the user observer:git.

The following section summarizes the steps necessary to create the bare instance. If you don't have root permission on the Solaris server you need to ask your administrator to create the user git:git and the root folder for your repositories (e.g /data/gitroot). Login as git and execute:

mkdir my_project.git
chmod 775 my_project.git
chmod g+s my_project.git
cd my_project.git
git init --shared=group --bare
cd hooks
mv post-update.sample post-update
To initialize the local repository (on UNIX or on Windows) I use the command clone git@myserver:/data/gitroot/my_project.git. In my environment the different GIT instances communicates using a secure shell (SSH) connection with public/private key authorization.

Update (28.10.2010)

Today I tried to clone a GIT repository from a new Solaris 10 server. The GIT client fails and displays the error "bash: git-upload-pack: command not found". The reason is that the default PATH environment variable doesn't contain the path /usr/local/bin. The solution of the problem is to add the missing path changing the file /etc/defaults/login.

No comments:

Post a Comment