Quick GitHub tutorial

Source: Internet
Author: User

First, you need to make it clear that git is a version management tool that can host code to any licensed place; GitHub is one of them.

I will not talk about applying for a GitHub account or anything.

After applying, you need to establish a unique connection with the local machine on GitHub. Implemented by the SSH public key, see: http://www.cnblogs.com/igrl/archive/2010/09/17/1829358.html


Upload code:

Before each code upload, create a repository on GitHub to copy its unique ssh.

Then enter the code folder in git bash,

Git init

Git add XXX1

Git commit-M "xxx2"

Git remote add origin xxx3

Git push-u origin master

XXX1 is a file to be hosted. You can use git add * to add all files in the folder, or use git add *. cpp to add all. cpp files in the folder;

Xxx2 is the description of this submission;

Xxx3 is the dedicated SSH repository mentioned above.

Note: (1)You can add multiple times before performing commit;

(2)Add can add.../to add the code in the subordinate folder of this folder. One advantage of this is that, at the same time on GitHubGenerate a folder.

Refresh now and check the repository on GitHub. Is there a lot more in it?


Download Code:

To download the code, open git bash, write down the SSH record of the project to be downloaded as XXX, and enter the command:

Git clone xxx

Check the root directory of git Bash. Is there an extra folder?

Quick GitHub tutorial

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.