Git Server Setting on Ubuntu

# Install GIT

$) sudo add-apt-repository ppa:git-core/ppa

$) sudo apt-get update

$) sudo apt-get install git-core

$) git version

 

# Create an admin account

$) sudo adduser git

$) su – git

$) cd ~

$) mkdir .ssh

$) sudo chmod 700 .ssh

$) cat id_rsa.pub >> ~/.ssh/authorized_keys

$) chmod 600 ~/.ssh/authorized_keys

$) rm -rf id_rsa.pub

# Security Settings

$) sudo vi /etc/passwd
(If the message “user id(account) is not in the sudoers file.” shows, see here.)

from

git:x:1001:1001:,,,:/home/git:/bin/bash

to

git:x:1001:1001:,,,:/home/git:/usr/bin/git-shell

Now the access is denied.

 

# Create repository

Login or connect git account to local or remote machine.

$) cd ~

$) mkdir [repo-name].git

$) cd [repo-name].git

If it is a first try,

$) git init –bare –shared

Or there is a being used repository

$) git clone –bare –shared [repo-url]

 

# Retrieve by client

$) git clone git@[git-repo-url]:test.git

 

Reference Source : http://webdir.tistory.com/220

 

 

Advertisements
Git Server Setting on Ubuntu

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