github open source own code

insert image description here

insert image description here
Next, we need to download Git first. The URL: https://git-scm.com/downloads. If there is no special requirement during installation, just go to the next step. After the installation is complete, double-click to open Git Bash and the following interface will appear
insert image description here
:

Step 1: cd into the address where you put the project file, my address is in D:\MYFILE\graduation\study\project program
insert image description here
Step 2: Enter git init
insert image description here

As shown in the figure below, this means to generate local git management in the directory of the current project (you will find that there is an additional .git folder in the current directory). Step 3: Enter git
add.
insert image description here
This is to add all files on the project Adding to the warehouse means that if you want to add a specific file, just replace . with the specific file name.
insert image description here

The fourth step is to enter git commit -m "first commit" to indicate your comments on this commit. The content inside the double quotes can be changed according to individual needs
.
insert image description here

If the following content appears here, you need to enter your account number or name
insert image description here

Enter your email address or name with the code prompted above
insert image description here

Then enter git commit -m "first commit" and it will succeed
insert image description here

The fifth step is to enter git remote add origin https://your own warehouse url address (as mentioned above) to associate the local warehouse with github,
here is git remote add origin https://github.com/Vivianyuwei/ Fabric-defect-classification-based-on-WLD.git
insert image description here

In the last step, enter git push -u origin master, which means uploading the code to the github repository.
insert image description here
Pay attention to the master in the upper right corner. If it is main, it should be changed to git push -u origin main, otherwise an error will be reported. After 2020, basically the prosperity automatically created by git is main.
insert image description here
If an error is reported, you can use git push -f -u origin main, f to indicate coverage
insert image description here

After execution, if there is no exception, it will wait for a few seconds, and then a window will pop up for you to enter Username and Password. You only need to enter your github login account and password.

Here is a solution to a common Git error written by others:

Guess you like

Origin blog.csdn.net/qq_43263543/article/details/129565170