Showing posts with label git. Show all posts
Showing posts with label git. Show all posts

Sunday, 23 June 2013

How to Create a shared Git Repository in Debian (ssh, git-daemon, gitweb)


Git is a distributed revision control system.

We are going to create a remote shared git repository and add the following functionality to it:

- Read and write access using ssh protocol.
- Anonymous read only access via git-daemon.
- Browse every git repository via web.
- Send an email notification when user pushes a commit.


This article shows how to set a Git repository in a Debian distro (Sid).


Create the repository in the remote machine


First we are going to configure the remote machine where the git repository will be installed.


Create a directory where we will place every git repository:
$ mkdir /gitrepo

Install git
$ sudo aptitude install git

Every user able to read and write to the git repository must pertain to gitgroup group.
$ sudo groupadd gitgroup
$ sudo chgrp -R gitgroup /gitrepo
$ sudo chmod g+w /gitrepo

Generic home for users pertaining to gitgroup group:
$ sudo mkdir /home/gitgroup
$ sudo chgrp -R gitgroup /home/gitgroup


We add our current user to gitgroup group.
$ sudo adduser my_user gitgroup
Changes will become effective after login in again.
$ groups
my_user sudo gitgroup


We create now a bare git repository
$ cd /gitrepo
$ git init --bare --shared=0664 my_git_project
Initialized empty shared Git repository in /gitrepo/bar/

NOTE:
0664: other user has read only permissions.
0660: other user has no permissions.

$ chgrp -R gitgroup my_git_project

--shared option sets directories, new files etc to the right permissions.


Now we have a bare repository where we could upload our commits or another preexisting repository.


Read and write access

Tuesday, 13 March 2012

How to build and install Vodafone Mobile Broadband / Wader in Ubuntu Lucid 10.4 LTS

WHAT IS THIS VMB / WADER THING?


Vodafone Mobile Broadband (VMB) is a 3G manager GUI software sponsored by Vodafone company.

Wader is a 3G manager daemon which deals directly with your mobile device.

VMB communicates with Wader via dbus.

Currently VMB/Wader supports "wvdial" and "Network Manager" backends.

Both VMB and Wader are written in python.

We are going to build and install them in a Ubuntu Lucid (10.4 LTS) system.


DOWNLOAD THE SOURCE CODE


VMB and Wader are not part of Ubuntu Lucid official repository, so we are going to build them from their sources.

First we need to install git to clone VMB and Wader repositories:

$ sudo aptitude install git-core
$ git clone https://github.com/andrewbird/wader
$ git clone https://github.com/andrewbird/vodafone-mobile-broadband


INSTALLING BUILDING DEPENDENCIES

Saturday, 24 December 2011

Git Command Quick Reminder

NOTE: You can find an updated version of this article in Git Command Quick Reminder


INSTALLING GIT
$ aptitude install git-core # git basic tools.

NOTE: In Debian Unstable
$ aptitude install git


gitk graphic tool.
$ aptitude install gitk # this graphic tool allows us to browse a git repo.



INITIALIZE A REPOSITORY

$ git init # Creates an empty repository in current directory, or reinitializes an existing one.
$ git init directory_name # Creates an empty repo in directory_name directory.

$ git clone remote_url # clone a remote repo. Passing as argument a local directory this command clones a local repo.

$ git clone --depth 1 git://git.sip.router.org/sip-router kamailio # clones sip-router source code, creating a local directory named kamailio. "depth 1" option means it only takes one revision history. That reduces the amount of history to download, but it disallows cloning, fetching, pushing or pulling from this repo. Then, it is only suitable to generate patches.

$ git clone source_repo dest_repo # clones a local repository source_repo in another local repository dest_repo,
if both are directories.
$ git clone file:///path/to/source/repo file:///path/to/dest/repo # another way to specify local directories.
This way we are sure git does not use hard links when cloning source repo.
$ git clone --no-hardlinks source_local_repo dest_local_repo # clone a repository and copy object files instead of using hardlinks for local repo objects.


GIT SVN