Upload a local project to GitHub and submit the code using the terminal command line

Source: Internet
Author: User

First step: Create your own repository on GitHub

Step two: Create a local repository CD to your local project root directory and execute the git command

1:$ CD to your project directory

2:$ git init

Step three: Add all the files from the local project workspace to the staging area

3:$ git Add.

Step three: Submit the file of the staging area to the local warehouse

4:$ git commit-m "comments"

Fifth step: Associating a local warehouse to GitHub

5:$ git remote add origin https://github.com/zhibinhsu/ShowAllLabel.git use your own URL ( the address of the warehouse you created to assign the address in the address bar)

This step if prompted error: Fatal:remote origin already exists. The solution is as follows:

  1. First delete the remote git repository $ git Remote RM origin

2. Re-add the remote git repository $ git Remotes add Origin https://github.com/zhibinhsu/ShowAllLabel.git use your own URL (the address of the warehouse you created to assign the address in the address bar)

Sync to Server

6:$ git push-f Origin Master

Upload a local project to GitHub and submit the code using the terminal command line

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.