Git server configuration in Linux environment

Source: Internet
Author: User

git server configuration in Linux environmentJump to: Navigation, search
Catalog [Hide]
  • 1 Install Git-1.8.0 (server side & Client)
  • 2 generate client SSH public key pair (can also be generated on the server side, and copy the key to the client for use?). )
  • 3 Add the client key to the server side
  • 4 server-side initialization code base
  • 5 client initialization code base, and push to server side
  • 6 execute git clone from another client to test the success of the push operation just now
[Edit]Install Git-1.8.0 (server side & Client)
    1. ./configure && make && sudo make install
[Edit]generate client SSH public key pair (can also be generated on the server side, and copy the key to the client for use?). )
    1. $ ssh-keygen-t RSA
      do not enter a password, direct return to
      generate id_rsa.pub (public key), Id_rsa (key) 2 files
[Edit]Add the client key to the server side
    1. The easy way: first copy the key file to the server side and then execute: $ cat id_rsa.pub >>/root/.ssh/authorized_keys
      • can also be done at the Client a command:
        1. SSH [email protected] "cat >> ~/.ssh/authorized_keys" <./id_rsa.pub
        2. Cat Id_rsa.pub | SSH [email protected] "cat->> ~/.ssh/authorized_keys"
    2. Server-side configuration: chmod 0700/root/.ssh && chmod 0600/root/.ssh/authorized_keys
      so the client SSH login will not need to lose password repeatedly
[Edit]server-side initialization code base
    1. $ cd/opt/repos/test.git && git--bare init
[Edit]client initialization code base, and push to server side
    1. $ cd my_working_dir && git init && git add readme.txt && git commit-m ' test '
    2. $ git Remote add origin [email protected]:/opt/repos/test.git
    3. $ GIT push origin master
[Edit]execute git clone from another client to test the success of the push operation just now
    1. $ git clone [email protected]:/opt/repos/test.git

Git server configuration in Linux environment

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.