Xcode 5 using a git remote repository

Posted on Wednesday, January 8, 2014

I recently had a friend
who is using Xcode and needed to set up a remote git repository for it. I am not an Xcode user so bear with me if I
miss some of the proper set up of Xcode.

Here is the set up and
instruction I used for him.

Set up a remote git Repository

I am going to set up a
git server on an Ubuntu 10.04 server.
This will be for the purposes of having a Remote Repository. I will create a user named "git"
who will be the user that has the actual git repositories. This use will not be able to login but will
be able to handle git uploads via ssh (if it has shared keys from users)

Create a git user

> sudo useradd -d /home/git
-s /bin/bash -m git

> sudo passwd git

Create ssh keys for git
user

> su git

> ssh-keygen -t rsa -b 2048

> touch .ssh/authorized_keys

Add authorized keys for
each user you want to use this git server.
In my case I was lucky enough to already have the keys I need under
another user (my own)

> su patman

> cd

> sudo cp
.ssh/authorized_keys /home/git/

> su git

> cd

> cat authorized_keys
>> .ssh/authorized_keys

install git

> sudo apt-get install
git-core

Now if you run this command

> which git

You should get

Change the shell for git

You do not want people to log in as a the git user. To fix this you need to set the shell the git
user uses to "/usr/bin/git-shell".
To do this run the following command.

> sudo chsh -s
/usr/bin/git-shell git

Now if you try to log in as the git user

> su git

You get this error.

You could still log in as this use if you add the shell in
the command like this

> sudo su -s /bin/bash git

Create a location to put the git repositories

Run the following commands to create a location to save
Remote Repositories