1. Preparation on Github

1. Register

2. On Github, click in blue next to the plus sign (+) in the upper right corner

3. Create a project name and description, and click


4. Go to this page and copy the address


Install Git

At this point you need to install Githttps://git-scm.com/downloadsOfficial Download websiteDownload as you like and follow the default options to Next

Use Github to upload projects

All right! Now we’re ready to go, to what I think is an important step

1. Right-click on a blank area in any folder and a menu bar will appear — > Git Bash Here

Git and remote repository link, need to configure the same username and mailbox as remote repository

① Check whether information is configured

git config --list
Copy the code

② Configure the user name and email address

Git config --global user.name Git config --global user.email Common email addressCopy the code

2. Create a version library

Mkdir projectCopy the code

A folder with the name project appears in the file, then use the command to enter the folder

cd project
Copy the code

By executing the init command, Git creates the repository instantly and appears in the Git folder in the project folder

git init
Copy the code

3.You need to copy files from your project into projectGit add

Git add.Copy the code

4. Use git status to check the status of the files you just copied

5. Submit the file. -m indicates the remarks of the submission information

git commit -m "first file"
Copy the code

6. Add remote repository (github)

Git remote add origin https://github.com/Github username/warehouse. GitCopy the code

7. You can then push the project to the Github repository

git push -u origin master
Copy the code

Some of my mistakes and solutions

1. The first time I tried to associate with the Github repository, I made a wrong call and tried again, but the error kept coming

Solution: Delete the association and re-associate it

git remote rm origin
Copy the code

2. Appear during Push

GH001: Large files detected. You may want to try Git Large File Storage. This question is the last step

git push -u origin master
Copy the code

The error occurred when I pushed the submitted file to Github. The error was caused by the “resource exceeding 100M”, so I deleted the large resource at this time


I push it again, and I’m done