Upload the local project to Github using the terminal command line and commit the code

Step 1: Create your own repository on Github

Step 2: 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 3: Add all files in the local project workspace to the staging area

3:$ git add . 

Step 3: Submit the files in the staging area to the local warehouse

4: $ git commit -m "comment"

Step 5: Associate the local repository to Github

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

If this step prompts an error: fatal: remote origin already exists. The solution is as follows:

  1. First delete the remote Git repository $ git remote rm origin 

  2. Add the remote Git repository again $ git remote add origin https://github.com/zhibinhsu/ShowAllLabel.git   use your own url (the address of the created repository, assign the address in the address bar)

 

Sync to server

6:$ git push -f origin master

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325816410&siteId=291194637