Showing posts with label tortoise. Show all posts
Showing posts with label tortoise. Show all posts

Sunday, November 15, 2009

Windows TortoiseGit client for a linux Gitosis server

Tortoise git is really nice Graphical tool to handle git repository. You need to download TortoiseGit from here. First of all as we discussed earlier you need to install msysgit first. Then install the Tortoisegit and install it. While installing it Select open ssh client option for authentication method.
And completely install it and restart your computer. First of all you should add the msysgit path for this system. Tortoisegit gets the git options from msysgit. Right click on your desktop and go to settings,Set the path to the bin of the msysgit. Now setting your authentication on the server should be set. For that TortoiseGit has shipped putty Keygen for generate keys. But in this case, since we are connecting with a linux server the private keys which generate by putty key gen won't be recognize by the server. Since that you will not recognized correctly at the server end. To avoid this inconvenience you can create ssh keys through ssh-keygen. On your command prompt.

Do not use puttyGen in this case to create key pairs.

Go to your account on the windows os(i.e. C:\Documents and Settings\Janaka), check whether there is a folder called ".ssh" if not, create it using command prompts "mkdir .ssh" command. This is the place we keep your key pairs. keys you generated (id_rsa.pub, id_rsa) copy to this folder. Now follow the usual users adding mechanism on git server.Click here for more info.
Now you can go to any location on your computer and right click select option git clone... or git zync you will receive following screen. Put the remote URL as to your git repository. git@192.168.4.90:my_first_repo It will import the repository to your local folder. Like wise all the operations can be done through GUI. You don't have to type git commands on doing this.
Any comments........???

Saturday, November 14, 2009

Setting up Gitosis(version control system) on Linux server and adding windows clients

Git is a kind of a version control system which allows users to keep their project information safely in repositories. In this case, I will be using Gitosis for this setup, Gitosis is a tool written for Git that helps in the setup of secure access controlled repositories. It will manage multiple repositories under one user account on the host machine. Using SSH keys to identify users, your repositories will be securely accessed and controlled. One large advantage to Gitosis is that your users will not need shell accounts on the machine to access repositories, they will however speak to a singular account what will not allow arbitrary commands. Now let's see how gitosis can install in to your Ubuntu server.

Installing Gitosis


First of all you should have installed Git.
sudo apt-get install git-core

By cloning the gitosis directory from "eagain.net" you will get the gitosis directory on your home page. Follow these lines to do it,
   cd ~/
git clone git://eagain.net/gitosis.git

Now you better move that folder to /usr/local
   sudo mv gitosis/ /usr/local

Now go to Gitosis folder.
   cd /usr/local/gitosis/

If you haven't installed python in your computer get it installed.
   sudo apt-get install python-setuptools

Then, you can run the setup.py file which is in this directory.
   sudo python setup.py install

Now you are successfully installed Gitosis on your Linux server.
Next, you have to create user called "git". "git" is the repositories holding real user. It creates in a way that users to identify through ssh-keys. Anyone can't login through entering password.
 sudo adduser \
--system \
--shell /bin/sh \
--gecos 'git version control' \
--group \
--disabled-password \
--home /home/git \
git

gitosis-admin


Now let's initialize the gitosis and begin with adding an administrator to git repository. As a convention we used to create administrator account on the same server/computer. Because administrator has the super power of creating new repository, users and so on.
To identify administrator, you need to create create ssh key and initialize gitosis with that key. So you will add as the administrator.(janaka is the user, versioncontrol is the name of the linux server)
janaka@versioncontrol~$ ssh-keygen -t rsa

Keep blank for the parse phrase of the key. Found this generated key pair at /home/janaka/.ssh/ as id_rsa(private key) and id_rsa.pub(public key).
Since janaka@versioncontrol wants to the admin and versioncontrol is the git server itself. You can directly initialize with this key.
sudo -H -u git gitosis-init < /home/janaka/.ssh/id_rsa.pub 

If your admin wants to be another user, generate this kind of key pair and copy it some where at versioncontrol(i.e. /tmp/id_rsa.pub). In this case,
sudo -H -u git gitosis-init < /tmp/id_rsa.pub 

If you are success then it will give,
Initialized empty Git repository in ./
Initialized empty Git repository in ./

Congratz, Now you are the gitosis-admin....!!!!
Now you need to make executable the post-update hook. Run following command.
sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update

Its ready to take your admin clone..............
git clone git@YOUR_SERVER_HOSTNAME:gitosis-admin.git

In my case YOUR_SERVER_NAME is "localhost". If you (admin) from another host, give the ip of the linux server/machine(versioncontrol).
Now have go to cloned gitosis-admin directory.
janaka@versioncontrol~$ cd gitosis-admin 

Have a look at the list,
You will found "gitosis.conf" file and "keydir" directory.
Have a look at the gitosis.conf file,
vi gitosis.conf

 [gitosis]                  

[group gitosis-admin]
writable = gitosis-admin
members = janaka@versioncontrol

Now lets see how to add users and creating new repositories.
Since this post getting longer, Follow Next post. click here

Adding Windows users to the gitosis and Many more