Build a git server for source code management

Source: Internet
Author: User
Tags git client

Git, which has been used for a period of time before, feels great. Therefore, we plan to use it for Development Asset Management in future official projects.

The installation and configuration process is as follows: Step 1: select a type. Git server construction methods: 1. It is easy to configure Based on git daemon, but it does not seem to support identity authentication. 2. In SSH mode, you need to add real users to the server. For me, it is not very nice. 3. HTTP is simple and convenient, but I don't want to install Apache any more. 4. Use gitosis/gitolite to build and configure the database. This method is complex but powerful. Finally, I thought about how to use it. 4. I checked some information about gitosis and gitolite. gitolite is more functional. Considering that gitosis has not been updated for more than a year, so we decided to use gitolite. Step 2: Install. The server I use is FreeBSD, so it is easy to install and use ports. First install git: CD/usr/ports/devel/git & make install clean and then install gitolite: CD /Usr/ports/devel/gitolite & make install cleanAfter the installation is complete, you will find that the system automatically adds a user named git, whose user directory is/usr/local/git /. Step 2: Configure. After the required software is installed, the configuration is left. First, generate a key pair: SSH-keygen-t rsa. Assume that the generated private key file name is Mars, and the public key file name is Mars. pub, and then generate the Management Library: Gl-setup Mars. pub, you will find /Usr/local/git/has several more directories. The repositories directory is used to place the GIT library, and you will find that there are already two git libraries: gitolite-admin.git and testing. Git.Next, you can use the private key generated to get the gitolite-admin.git Library: git clone git @ server_ip: gitolite-admin.git and then set gitolite by modifying some files in the gitolite-Admin library, see https://github.com/sitaramc/gitolite for details .Supplement: install and configure the GIT client on Windows. The Windows client is actually very useful, especially tortoisegit, so that you can save time and convenience. To install tortoisegit, you need to install msysgit first, and then pay attention to selecting ssh. This makes it easy to use the private key file mentioned above. Copy the private key file to the C:/user/you_user_name/. Ssh/id_rsa file, and connect to the configured git server.

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.