Jai’s Weblog – Tech, Security & Fun…

Tech, Security & Fun…

  • Jaibeer Malik

    Jaibeer Malik
  • View Jaibeer Malik's profile on LinkedIn
  • Subscribe

  • Feedburner

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 28 other followers

  • Archives

  • Categories

  • Stats

    • 275,828
  • Live Traffic

Gitorious: Ways to share your Git repository

Posted by Jai on October 28, 2013

We will cover the different ways you can share your remote git repository over internet. Gitorious is one of such solution allowing you to do same and we will cover how to get it up and running, configuring users, authentication mechanism, setting up ssh connection and setting up git repositories.

Git Repository

In the last post we covered to migrate svn repository to git repository , which means you already have your git repository set up done.

Share git repository

Check out the different possible ways to share your git repository,

  • File Share
  • SSH server git-shell
  • Apache http
  • Apache http + gitweb
  • github
  • gitorious
  • etc.

Choose the which suit best to your team requirements, company data policies, security requirements, user management, access control etc.

Git server over http

git-http-backend, “A simple CGI program to serve the contents of a Git repository to Git clients accessing the repository over http:// and https:// protocols.”

Follow the steps to setup git server over http,

Exposing git repository on Apache server. Enable WebDAV on apache server.

For authentication over http for apache, check out the steps,

Git server over https and gitweb

Git web gui inteface for git repository over https,

Read out the steps to configure gitweb interface for your git repository.

github

Github allows you to host your project git repository online. It depends on your company policy to allow to host your git repository data outside your internal network.

There are also other commercial players in market which host git repository data for you.

Atlassian Bitbucket scm-manager

Bitbucket scm-manager allows you to share and manage your Git repository.

Read the migration guide from svn to git on bitbucket, Migration Guide for Subversion to Git on Bitbucket 

Gitorious

Gitorious is “open source Git hosting and collaboration”. You can try community edition to run your own git server to host git repositories.

Installation

Check out the steps, requirements to install gitorious locally on Install Gitorious page

#Install git, if you already don't have it
$ yum install -y git

#Get gitorius from github
$ git clone https://git.gitorious.org/gitorious/ce-installer.git && cd ce-installer

#Install gitorious
./install

The installation prcess will take sometime to install the server, checking environment settings and downloading relevant packages.

To uninstall gitorious the package, remove the corresponding files.

To access the newly installed gitorious server access the link https://<hostname.com&gt;

Documentation

Check the step to get started with gitorious.

Check FAQ  for general questions.

Check general gitorious tasks, for regular tasks.

Users setup

To create the administrator user,

$ cd /var/www/gitorious/app && RAILS_ENV=production ruby script/create_admin

#Type in the email address and password for the admin user

To create additional users, Login as admin user and go to url users https://hostname.com/admin/users And click on create new user https://hostname.com/admin/users/new

Projects/Teams/Permissions

Go to Projects section to create your own project. https://hostname.com/projects/new

You can create separate teams inside your projects to be able to grant project level or git repositories level permissions to different teams or users. https://hostname.com/teams/new

Create git Repository

Go to your newly created project and click on Add repository link https://hostname.com/projectname/repositories/new

A bare git repository will be create for you and you should be ready to push data to this git repository.

Set up ssh key authentication

Follow the steps to set up and test SSH git connection.

1. Generate ssh private/public SSH keys on your environment.

Refer to Generate SSH Keys,
Windows: You may use putty (PUTTYGEN.EXE) to generate the key.
Unix: ssh-keygen -t rsa

You may leave passphrase blank to avoid entering the the same each time (but if entered, it can be set in eclipse also)

2. Update SSH key in gitorious.

Login to gitorious->Click on Dashboard in to navigation->Click on Manage SSH Keys->Click Add SSH key->Check signal tick icon once it is ready to use.

3. To test the connection, that it works well with the prompt check welcome message

Command: ssh git@
Welcome, . Use git to push/pull your repositories

Now you should be ready to access your git repository.

Push data to git repository

By this step you should already have git bare remote repository, authentication etc. in place. The next step is to push the data to remote git repository.

$ git remote add origin git@<hostname.com>:<projectname>/<gitrepositoryname>.git

$ git push -u origin master

# If you want to push everything
$ git push -all

Git Eclipse integration

To integrate the new remote git repository with Eclipse,

Download Egit plugin

Check out the user guide to configure Egit.

Update Eclipse ssh settings for your generated keys, Refer to Eclipse_SSH_Configuration

This should get you up and running with the remote git repository ready to be shared with the team.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

Join 28 other followers

%d bloggers like this: