Git manages the use of remote repositories

Source: Internet
Author: User

As a qualified programmer, how can you not use GIT to manage remote repositories? Today, let's learn how to use git to manage remote repositories.

Take Maon as an example. First, you want to set up a remote repository. Registration Code Cloud Account, unlike GitHub, it is a pure Chinese version, so as long as you register the account, you know how to do. After registering your account, you can create a new project on top. We just have to learn how to download it and upload it.

Download: The first download requires the use of the command: Git clone key address. Note that if you use the address above HTTPS, you will be asked to enter your username and password each time you download it. If you don't want to be so troublesome, you can now generate a key pair (both public and private) on Git. Command: ssh-keygen-t RSA. Then find your public key (usually one in the local home directory.) SSH in the price folder, copy all the content, and then paste the copied public key into your remote repository (such as GitHub), then the next time you pull the file from the remote repository, with the address on the SSH, you do not need to enter the user name and password every time 。 Once the file is downloaded, you are free to manipulate it (modify, add, delete

, query file contents or files are all right), you can also create your own local branch, operate on your local branch, and then confirm the error after merging with the main branch so that you can protect the main branch. The last problem is uploading. You have modified the file, of course, to upload it to the remote server, then only need a command: git push key address.

By doing this, you managed the GIT remote repository successfully!

Git manages the use of remote repositories

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.