Git version control Ubuntu build git server

Source: Internet
Author: User
Tags free ssh git client version control system

  Git is an open source distributed version control system that can efficiently and efficiently handle project versioning from very small to very large. Allows developers to clone (git clone), copy a full git repository on the local machine, or commit the code to a git server.

First, the environment

VMware creates an Ubuntu virtual machine as a git server, and the client is built under Windows system.

Second, Ubuntu build git server

1, Installation OpenSSH

Command: sudo apt-get install Openssh-server

2. After the installation is complete, check that the SSH service is started

Command: Ps-e|grep SSH

3. Create git user to manage running git service

Command: Useradd git/adduser git

Note: The Useradd command does not create a user folder in the/home directory, and AddUser creates

4. Install git

Command: sudo apt-get install Git-core

  Note: sudo execution will error

Workaround: Go to root (su), add write permission to the file (chmod u+w/etc/sudoers), edit the/etc/sudoers file (vi/etc/sudoers, add git all= (All), and then save the exit.

5. Initialize the server-side git repository

Command: Git init--bare/home/git/myrep.git

Third, Windows build git client

1, go to git website download (default option to install)

Https://git-scm.com/downloads

2, after the installation is complete, right-click on the desktop will appear "Git GUI here" and "Git bash here" or in the Start menu has git shortcut, click Git bash here, the command box appears

3. Configure password-free SSH login on Windows client

Command: ssh-keygen-t RSA

Generate the key under the Windons user under the/.ssh folder

Copy the generated public key id_rsa.pub to the Ubuntu server

Create the. ssh folder on the Ubuntu server and enter the directory to create the Authorized_keys file, append the public key content to this file after creation is complete

Command: mkdir. SSH

Touch Authorized_keys

Cat Id_rsa.pub >>/home/git/.ssh/authorized_keys

Iv. Testing

On windons, open git bash and enter the command to clone (Ubuntu Service Area ip:192.168.1.102) (Empty project)

Command: Git clone [Email protected]:/home/git/myrep.git

And then on the desktop you'll find the clone down directory

Since this simple GIT version control server has been built, the following bloggers will continue to update the more detailed information about GIT!!!

  

  

Git version control Ubuntu build 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.