Upload local code to GitHub

Source: Internet
Author: User

First step: Build a git repository
CD to your local project root directory, execute the git command

git init

Step Two: Add all the files of the project to the warehouse

add .

If you want to add a specific file, simply change it to a specific filename.

Step three: Commit the Add file to the repository

commit -m "注释语句"

Fourth step: To create your own repository on GitHub, create the page as shown:

Click on the Create repository below, you will go to a page similar to the one below, get the HTTPS address of the warehouse created, the red box is marked

Fifth step: Focus on the local warehouse to GitHub

add origin https://github.com/hanhailong/CustomRatingBar

The following HTTPS link address is replaced by your own warehouse URL address, which is the red box above the winning address

Sixth step: Before uploading GitHub, pull it first and execute the following command:

git pull origin master

After hitting enter, the output will be executed similar to the following

Seventh step, the last step, upload the code to GitHub remote repository

push -u origin master

After execution, if there is no exception, wait for the completion of the upload successfully, the middle may let you enter username and password, you just enter GitHub's account and password on the line

Finally, attach the code after the successful upload:

Uploading local code to GitHub

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.