Setting up a Git server on Ubuntu, accessing from Mac OS X

This wiki post walks you through the key steps configuring a Git server on Ubuntu.

Edit 4/3/12: there’s a lot of other articles on how to setup gitosis on linux – here’s some I followed, but they all have slight variations in the approach: here, here, and here. It seems somewhat hit and miss whether it works or not (as you’ll find if you google for related articles). For me, I could only get this approach working for the user in the gitosis-admin group, and I could not get access for any other users, despite how many variations of the setup instructions I worked through. There’s numerous comments that gitosis is also no longer supported and to use gitolite instead, so I’m going to try installing gitolite instead and will write another post on using this approach . See here for my notes on setting up gitolite, which by the way I got setup with no issues at all.

The setup steps in the wiki article walk you through setting up a gitosis user through which you connect using an ssh public key – since I was trying to follow the instructions but not really sure what I was doing, the key steps (once you’ve already done the above setup) are:

  • if you already have an ssh public key, copy it to your remote server and then add it for the gitosis user with this step:
sudo -H -u gitosis gitosis-init < your.pub_file

If you don’t have a .pub file in your ~/.ssh dir, create one with the steps here. This step is only done one time, for your admin user to get the gitosis-conf project setup.

To add new projects and users is via the gitosis-admin project which you clone from your new server. Once you’ve pulled the project local, all admin of adding new projects is done via making changes to the gitosis.conf file and then pushing the change back to the server.

To add a new group/team add a new section like this:

[group group_name_here]
members = dev1@host1 dev2@host2 dev3@host3
writable = Project1 Project2

Notice the members and writable list of source project are space separated, not comma.

For each new user, add their .pub ssh file to the gitosis-admin/keydir directory, named user@host.pub, where user@host matches their id and host at the end of the key details in the file.

Add, commit and push them to the server:

git add .
git commit -m "added new key files"
git push

To push a new project for the first time, eg’Project1′

  • cd into the project you’re adding for the first time and add your remote:
git remote add origin gitosis@your_server_name:Project1.git
  • Add, commit and then push your code on the master branch:
git add .
git commit -m "commit message"
git push origin master

Subsequent pushes, you can just do ‘git push’

WinFS – where are you?

I remember back before ‘Longhorn’ was released (which became Windows Vista) that one of the selling points was a replacement file system that at the time sounded like it was going to be a revolutionary replacement for the long established MS-DOS style file system with it’s hierarchical directory structure.

Sadly this never saw the light of day, but what made me think of this was this set of slides from Microsoft which are selling points for how a Windows 7 based tablet will compete with the success of the iPad. One particular slide caught my eye: Windows 7’s ‘rich, searchable file system’ is a selling point compared with iPad’s ‘no filesystem’ (according to the slides).

The funny thing about this (to me, at least), is that the majority of PC/Windows users (non-technical) have pretty much no idea of what the file system is on Windows, how it is structured, and how to store and their files sensibly (and no, storing all your documents, photos, and mp3s in the same directory is not sensible).

It’s always a reality check for me when you say something like ‘create a folder on c: and save your doc there so you’ll remember where you put it’ and your met with a blank stare and ‘err, how do I do that?’

It’s possible that a ‘revolutionary’ file system replacement for Windows (possibly would have been backed by a SQL Server backend?) may have been a step forward for Windows, but sadly this never appeared, and we’re still stuck with the heritage of MS-DOS lerking in the background.

The fact that Microsoft internally believe the Windows filesystem is ‘rich’ kind of boggles the mind. It’s richness is debatable, but the fact is that the majority of Windows users have no idea how to sensibly store their files on this ‘rich’ filesystem. Recent changes in Vista and 7 seem to default to saving files to the Desktop, which in itself is interesting when you see a user’s desktop which is entirely covered in all their document icons for the past couple of years, and they’ve no idea where they all come from, or how to organize them.

The Mac OS X approach is interesting from my opinion as a recent Mac switcher in the past couple of years, since the Finder has a couple of broad categories: ‘Documents’, your user folder, and Applications, which for most people is adequate and it’s easy to create additional folders within these areas, and what’s interesting from a technical point of view is that the actual physical location of the files on the file system is transparent to the user, and they never have to actually know where these locations are within the file system tree. BUT if you do want to dig deeper, as a technical user, it’s possible to navigate the *nix based file system structure at a level beneath the what the Finder shows you (or jump directly to directories in Finder if you know where to go). This dual approach is interesting to me, because it functions perfectly well for both types of users – non-technical users are shielded from the physical file directory structure by Finder, and technical users can dig deeper if they need.

I’m really not sure who these slides from Microsoft were written by or who they are aimed at, but I think it’s typical of Microsoft of the past few years that they really just don’t seem to get it.