Ubuntu 16.04 Build a git small server

Source: Internet
Author: User
Tags git client git clone

Recently built a small Git server, because the online data mixed, let me really stepped on a lot of landmines. Make a record in case of a rainy future.

What do you need to know?

If you want to build a server for only dozens of people to use, and no dedicated network management services, remember, must be simple, simple, only need to follow

I do the following steps to the line, and other what gitosis,gitolite, do not use, detailed reasons for reference:

Https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/ 00137583770360579bc4b458f044ce7afed3df579123eca000

The following describes the installation process for installing GIT server:

1 Creating Git users and adding. SSH directories

 the . ssh$ touch. SSH  Ssh/authorized_keys.

Next, you need to add some developer's public key to authorized_keys the contents of the file's public key similar to the following:

$ cat/tmp/id_rsa.john.pubssh-rsa aaaab3nzac1yc2eaaaadaqabaaabaqcb007n/ww+  oun4gslkssmxxnbovf9lgt4lojg6rs6hpb09j9r/t17/x4lhja0f3fr1rp6kybrswj2athgw6hxlm9/5zytk6ztg3rpkk+  4kyjh6541nysneazuxz0jttyaufrtu3z5e003c4oxoj6h0rfif1kki9maqlmdpgw1gyeigs9ezsdfd8acciictdwbqlacu4upkax8kygllwsnuugztobf8m72 ALC/nlf6jltpofwfblgc+  Myivo7tcusbdlqlgmvofq1i2upwqokowqahukeomfjy2jctxsdbq220ymjansht4kgtzg2ayygpqdav8jggjicuvax2t9va5 GSG- KeyPair

You only need to add them to the Authorized_keys file in the SSH directory, you can paste the copy directly, or you can use the command line similar to the following:

$ cat/tmp/id_rsa.john.pub >> ~/.ssh//tmp/id_rsa.josie.pub >> ~/.ssh//tmp/id_ Rsa.jessica.pub >> ~/.ssh/authorized_keys

Next you need to create an empty on the server:

$ cd/srv/-- in/srv/git/project.git/

The server-side configuration ends here.

2 Configuration of the client:

On the computer, configure the command to initialize the GIT client and trunk:

# on John's computer'initial commit'$ git remote add origin [ Email protected]:/srv/git/project.git$ git push Origin master

The next step is to synchronize the local git files to the server side.

$ git clone [email protected]:/srv/git/'fix for the README file'$ git push o Rigin Master

Until now, the task is complete, to the server side to see if it has been synchronized to this.

Reference Documentation:

1 https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server

Ubuntu 16.04 Build a git small 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.