Git uploads local items 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

git 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

git commit-m "comment statement"

At this point, if you see me who is, you need to execute the following command:

git config--global user.email "your email"--global user.name "your name"

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

Click on the Create repositorybelow, 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

Git remote add Origin Https://github.com/Chrdai/getUserPriv

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

Git push-u Origin Master

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

If the update file only needs to be executed:

First step: Add the files for the project that need to be updated to the warehouse

Git add ' requires an updated filename '

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

Step Two: Commit the Add file to the repository

git commit-m "comment statement"

Step three: Before uploading GitHub, pull a bit and execute the following command:

Git pull Origin Master

Fourth step, update the code to GitHub remote repository

Git push-u Origin Master

git included:https://git-for-windows.github.io/

This article refers to Bo Friends of the blog, with Bo Friends of the original link:http://blog.csdn.net/hanhailong726188/article/details/46738929

If reproduced, please specify the source:http://www.cnblogs.com/chrdai/p/8145153.html

Git uploads local items 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.