Git remote repository easy to create

Source: Internet
Author: User

Many times, in order to manage the code we write, we use a git remote repository for management and backup. Prevent code from being tampered with or deleted by others. So how do you create a remote repository?

1, we must have a remote server side, here can be any one computer as a server, create the steps:

[Email protected]:~$ pwd

/home2/boxbuilder

[Email Protected]:mkdir remote.git

To create a bare library, method:

[Email protected]:~$ git init--bare

Initialized Empty Git repository in/mnt/.mh/.fj/.ps/git/remote.git/

A remote repository has already created OK.

2. Create a git library locally and make it a library that you do not need to commit

Git init
git Add.
git ci-m "Test init."

Git remote add test ssh://[email protected]/home2/git/remote.git
git push test Marster


3. Other people need to use

git clone ssh://[email protected]/home2/git/remote.git

4. Execute submit push without server address

git push
Git pull

Git remote repository easy to create

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.