CentOS installation configuration Git server (gitosis)

Source: Internet
Author: User
Tags git client

1. Install the GIT client (in order to clone the Gitosis repository)
To install a dependency package:yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel
To install Git: yum install git
After the installation is successful, you can usegit --versionTo view the installed Git version number
2, Installation Gitosis
To install the Python tool:yum install python python-setuptools
Execute in turn:
git clone git://github.com/res0nat0r/gitosis.git
cd gitosis
python setup.py install
#显示Finished processing dependencies for gitosis==0.2即表示成功

3. Generate the public key and corresponding key on the development machine (my development machine is Win7 64bit)
PS: This step assumes that Git for Windows (http://msysgit.github.io/) is installed on the development machine and adds C:\Program Files (x86) \git\bin in the environment variable path.
ssh-keygen -t rsa
Follow the prompts to get a id_rsa and a id_rsa.pub (public key) that are copied to the C:\Program Files (x86) \git\.ssh directory.
4. Upload the public key to the server and initialize the Gitosis
Upload the id_rsa.pub to the server/tmp directory and build the GIT user on the server, using the GIT user and initializing the Gitosis
adduser -m git
su - git
gitosis-init < /tmp/id_rsa.pub
#显示以上信息即表示成功
#Initialized empty Git repository in /home/git/repositories/gitosis-admin.git/
#Reinitialized existing Git repository in /home/git/repositories/gitosis-admin.git/

5. Clone Gitosis-admin.git Management Repository
The purpose of the Gitosis-admin.git repository is to manage all gitosis sub-repositories globally, so clone to the local and modify the configuration file, then push to the server, you can implement the management of other repositories, such as users, permissions and so on.
Execute in the command line of the development machine
git clone ssh://[email protected]服务器IP:SSH端口/gitosis-admin.git
If you can clone out of the Gitosis-admin repository, the basic configuration has been completed.

Start the new repository below
6. Edit New Project Permissions
Edit the clone gitosis.conf file on the development machine and add it at the end of the file:
[group test-git] # 组名称
writable = test-git # 项目名称
members = [email protected] #密钥用户名,参照gitosis-admin组的配置

Then add, commit, and push
git add .
git commit -m ‘add test-git’
git push

7. Build new Project Warehouse and submit
Create a new project folder on the development machine, on the command line CD to the folder, execute the command below
git inti
touch readme
git add .
git commit -a -m "init test-git"
git remote add origin ssh://[email protected]服务器IP:SSH端口/test-git.git
git push origin master

Each subsequent modification of the submission is the add commit push such a process, do not make a statement.

Reference documents:

http://blog.longwin.com.tw/2011/03/linux-gitosis-git-server-2011/

Http://www.cnblogs.com/vicowong/archive/2013/05/06/3062397.html

CentOS installation configuration Git server (gitosis)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.