Create a remote warehouse and associate the local code to the remote warehouse

Use github or coding

Way 1

When creating a project on the code hosting platform, initialize README.md, .gitingore, LICENSE and other related files, and then click the right mouse button in the folder corresponding to the project to open Git Bash Here
Insert picture description here
through the git clone url command to remotely The warehouse code is cloned; at this time, there will be an extra folder under the current folder (there are three files README.md, .gitingore, and LICENSE), copy these three files to the upper level directory, and then copy this file Delete the folder; at this time, the local code is associated with the remote warehouse, and then the normal local code is submitted and pushed to the remote warehouse.

Method 2 (different from method 1: do not use the README.md, .gitingore, LICENSE and other files created by default in the code repository, and the first commit seen in version Control is not "Initial commit")

Create a project, do not initialize the README.md, .gitingore, LICENSE files, get the git url, add remotes, commit related code, and push in the ide.
Insert picture description here

This record only

Guess you like

Origin blog.csdn.net/nongminkouhao/article/details/114657566