Teach you to upload local code to GitHub reprint

Source: Internet
Author: User

original July 03, 2015 10:47:13
    • Label:
    • Upload code GitHub

Reprint please indicate the source:
http://blog.csdn.net/hanhailong726188/article/details/46738929
This article is from: "Dragon's Blog"

Before the beginning of the next topic, previously written a blog, ios-step-by-step to teach you a custom rating star Ratingbar, the group of people want the source code, I uploaded to GitHub, there is a need to see, GitHub address custom rating Star Bar

Well, recently someone in the group asked how to upload the newly created local code to GitHub, here is a simple record, I like to use the command line, which is fully implemented in the command line, do not understand the git command can be understood under.

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

git init
    • 1

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

add .
    • 1

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 "注释语句"
    • 1

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
    • 1

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
    • 1

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
    • 1

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:

Thank you!

Teach you to upload local code to GitHub reprint

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.