Local project is linked to Git

Step 1: Create a git repository 

cd to your local project root directory and execute the git command

git init

 

Step 2: Add all files of the project to the repository

git add .

 

If you want to add a specific file, just replace . with a specific file name

Step 3: Commit the add file to the repository

git commit -m "comment statement"

 

Step 4: Go to github to create your own Repository, and create a page as shown below: 

 

Click on Create repository below, you will enter a page similar to the following, and get the https address of the created repository. The red box indicates the 

 

Step 5: The point is here, associate the local repository to github

git remote add origin https://github.com/liupeng1204/angular2App.git

 

Replace the following https link address with your own warehouse url address, which is the address marked in the red box above

Step 6: Before uploading to github, pull it first and execute the following command:

git pull origin master

 

The seventh step, which is the last step, upload the code to the github remote repository

git push -u origin master

 

After the execution, if there is no exception, the upload is successful after the execution is completed. You may be asked to enter Username and Password in the middle. You only need to enter the account and password of github.

 

Guess you like

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