User and Repository List

Git Client Setup and Usage

Install Client Tool

  1. Download msysgit from (Git- for current)
  2. Download Tortoisegit from (depend on the architecture)
  3. Install msysgit first and then install Tortoisegit

Server Administration

Install Git Server

  • Install Python setuptools
sudo apt-get install python-setuptools
  • Get source code and install
git clone git://

cd gitosis
python install
  • Add Git server administration account
sudo adduser \
    --system \
    --shell /bin/sh \
    --gecos 'git version control' \
    --group \
    --disabled-password \
    --home /home/git \
  • Generate a SSH key and initialize Git server
ssh-keygen -t rsa
sudo -H -u git gitosis-init < ~/.ssh/

# This command is very important!
sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update

Add User

  • First, we need clone server config files. Skip this step if you've cloned the respository.
git clone
  • Enter the administration directory
cd gitosis-admin
  • Generate a new SSH key pair and put the public key in keydir/
# save key pair to ~/gitkeys/USERNAME
ssh-keygen -t rsa
copy ~/gitkeys/ keydir/
git add keydir/
git commit
git push

Create Respository

To create a repository, just add the respository name to writable attribute in gitosis-admin/gitosis.conf

For example, if we want to create a respository named test_repos for user whitestone:

  • Edit the local copy of gitosis.conf and add the following lines
[group test_group]
members = whitestone root@rswiki
writable = test_repos
  • Commit the change
git add gitosis.conf
git commit
git push
  • Create a local directory for the respository and commit it.
cd /tmp
mkdir test_repos
cd test_repos
git init
git remote add origin
git push origin master:refs/heads/master
documents/git/git.txt · 上一次變更: 2010/03/03 10:55 由 whitestone
CC Attribution-Noncommercial-Share Alike 3.0 Unported Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0