Build a git server locally under a Linux system

Source: Internet
Author: User

Linux system how to build a local git server, for the team to store the development code, the following steps:

1. Install git with one server first, install Linux, and choose Ubuntu 14.04 here. Then configure the static ip:172.16.0.110. Execute the following command:

>> sudo apt-get install git

2. Create a git User:

>> sudo adduser git

3. Create a/home/git/.ssh/authorized_keys file and copy the ~/.ssh/id_rsa.pub file of each team to the above file, one at a-line.

4. Create a git repository in the/srv directory:

>> CD/srv>> sudo git init--bare ourwiki.git

If you are building a git repository remotely, log on to the server first (guaranteed to be the same LAN):

>> ssh [email protected]172.16. 0.

Then proceed to the above steps.

5. Modify the owner of the GIT repository:

>> sudo chown-r git:git ourwiki.git

6. Cloning the project:

>> git clone [email protected]172.16. 0.110:/srv/ourwiki.git

7. After cloning (empty folder, you must add a small file, general Readme.txt can, submit the following code to execute later):

Submit Code:

>> git add-A>> git status>> git push Origin master

After cloning, switching branches can be created (switching to a branch that does not automatically creates a branch):

>> git checkout-b release

The same way you create a readme document, submit it.

Build a git server locally under a Linux system

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.