Showing posts with label Tortoisegit. Show all posts
Showing posts with label Tortoisegit. 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........???

Creating gitosis repository and adding users to projects

Cont from, Previous post

Adding new repo(gitosis.conf)


Administrator is the only authenticated user for this (In according to previous posts in my case it's janaka). First administrator can log to the server which runs git.First it is better to add the repository on the conf file. And you can add users for this repository.
janaka@versioncontrol~/gitosis-admin $ vi gitosis.conf

Your conf file look like this,
[gitosis]                  

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

Edit it and add new repo, Now it will looks like,
[gitosis]                  

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

[repo my_first_repo]
gitweb = no
description = This could be my first repo
owner = No one else thats me,
daemon = no

Creating a user group


Your conf file look like this,
[gitosis]                  

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

[repo my_first_repo]
gitweb = no
description = This could be my first repo
owner = No one else thats me,
daemon = no

Edit this file and add new group,

[gitosis]                  

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

[group my_users]
writable = my_first_repo
members = janaka@versioncontrol gituser1

[repo my_first_repo]
gitweb = no
description = This could be my first repo
owner = No one else thats me,
daemon = no

gituser1 is the newly added user, his key is named as gituser1.pub on keydir/ directory.
Now you should add this changed gitosis.conf file and update gitosis-admin repository. You can do it by executing following commands.
janaka@versioncontrol~/gitosis-admin$ git add gitosis.conf
janaka@versioncontrol~/gitosis-admin$ git commit -m "Added new repo on conf file"
janaka@versioncontrol~/gitosis-admin$ git push

Then you can create the directory you want and create physical repository.

Creating new repository


Create a directory with naming it on your wish.
janaka@versioncontrol~$ mkdir my_first_repo
Now go into it, Don't forget to add some files before initialize this repo. Otherwise it will not be added as a repository,
janaka@versioncontrol/my_first_repo~$ touch readme
then follow the given commands to initialize the repository,
cd my_first_repo
git init
git remote add origin git@192.168.4.90:my_first_repo.git
git add .
git commit -m "Hai buddies, we added my_first_repo"
git push origin master:refs/heads/master
192.168.4.90-is the server which runs git on it. Now the new repository is created.
This is it, now gituser1 can use the my_first_repo repository. You can check on client machine,
git clone git@192.168.4.90:my_first_repo

On windows client side, If you'r only using command prompt, why don't you go for TortoiseGit to make life easier. TortoiseGit is a graphical tool to access git repository. Follow

"Graphical controls for Git windows clients"

link and study it.