Git Learning-Remote repository

Source: Internet
Author: User

1th step: Create SSH Key

In the. SSH directory under the user directory, see if there are two files for Id_rsa and id_rsa.pub, and if not, generate a key pair with the following command:

  $ ssh-keygen -t rsa

2nd step: Login to GitHub, open "Account Settings", "SSH Keys" page:

Add content for Id_rsa.pub

3rd step, create a remote repository

On the GitHub Web page, follow the prompts to create a

4th step, connect the local and remote libraries

local library = Remote Library

In the local repository (if not, create first), run the command:

    git remote add origin [email protected]:xxx/test xxx for your username, test for created remote warehouse name, origin for remote warehouse alias

    git push-u Origin master pushes the contents of the local library to the remote, with git push the command, actually pushing the current branch master to the remote.

From now on, as long as the local commits, you can pass the command:

    $ git push origin master

Push the master latest changes from your local branch to GitHub, and now you have a truly distributed repository!

Remote Library = = Local library clone

Run in the appropriate local directory:

    git clone [email protected]:xxx/test (SSH protocol, can also choose Other protocol HTTPS, etc.)

Git Learning-Remote repository

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.