Build a git code server

Source: Internet
Author: User

in code management, you usually need to use version management tools, Git is a good choice, here is a simple list of Git server building process.
1. Install the GIT toolkit

2. Initialize the GIT library: on a code server, you typically only need to create an empty warehouse that does not contain a working directory, using commands, git--bare init
After the creation is complete, you can see the resulting file
HEAD Branches config description Hooks info Objects Refs

3. After the GIT library is created OK, you can clone the empty library to a localgit clone ssh://[email PROTECTED]/HOME7/HUNTERDING/HDCP HDCP

4. You can then edit the code locally and upload it to the server
git push Origin master
git pull Origin Master


usually when accessing the server, you need a password, you can use the SSH protocol to simplify the operation,
SSH:ssh is the abbreviation for Secure Shell , which is a security protocol based on the application layer and the transport layer. SSH is currently a more reliable protocol that provides security for Telnet sessions and other network services.
There are several ways to simplify password entry using SSH:
1. locally generated key pair
Most Git servers will choose to use the SSH public key for authorization. Each user in the system must provide a public key for authorization, and none will generate one.
$ ls~/.ssh
MainSee if it's used. somethingAnd something.pubTo name a pair of files, this somethingis usually id_dsaOr id_rsa.pub the file with the suffix is the public key, and the other file is the key. If you don't have these files, or simply .ssh don't have a directory, you can ssh-keygen create them.

2. Copy the generated public key to the Authorized_keys file on the code server
#* * * represents the encryption method and copies the public key to the Authorized_keys file. If you have a lot of computers to configure, copy all the id_***.pub public keys to a Authorized_keys file 
Note: Place the user directory in the. ssh folder.

3. Verify that it is successful
$ SSH [email protected]

Attention:
1. You can only access Authorized_keys's computer on the computer where you generated the key, if you want to access both computers password-free. Then you need to repeat the above steps (the machine is configured exactly the opposite).
2. If the procedure is correct, the password is still required. This is generally because of a permission issue. The command is as follows:
644 ~/.ssh/authorized_keys

Build a git code 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.