Initialize the project for the first time and submit the project to GitHub

This blog is mainly used by myself to prevent similar problems next time, and to quickly locate and solve problems

1) Steps to submit the code to github after the project is initialized: https://blog.csdn.net/wyjares/article/details/81978816

2) If the local project and the remote project establish contact, execute the command git push origin master -u to report the following error:

[email protected]: Permission denied (publickey). Could not read from remote repository.

There are two reasons for the above error:

  • The client and server do not generate ssh key
  • The ssh key of the client and server do not match

For specific solutions, refer to the link: https://www.jianshu.com/p/7d57ce4147d3

Pro-test effective 

 

3) Check whether the key exists locally: ls -al ~/.ssh

If there is a file id_rsa id_rsa.pub, it means that the key already exists

4) View the content of the public key: cat ~/.ssh/id_rsa.pub

5) Generate SSH key: ssh-keygen -t rsa -C "own Email address"

 

If you have already created ssh on github, you need to create a new project locally and submit it to github. The operation is as follows:

1. Use vue-cli to initialize the vue3 project locally: (assuming that vue-cli has been upgraded on the computer) -----vue create projectname (select the vue3 project)

2. Go to the project root directory and turn the project into a warehouse that git can manage: git init

3. Create a warehouse on github and copy the ssh address of the warehouse

4. Associate the local project with the remote git repository: enter ---git remote add origin'repository address' on the local command panel

5. Push the local content to the remote warehouse: git push origin master -u

So far, push the newly created project to the remote warehouse

 

 

 

 

Guess you like

Origin blog.csdn.net/tangxiujiang/article/details/109170258