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