Deploy the project to GitHub (detailed)
premise
Already registered a GitHub account
Create repository
Enter the + in the upper right corner of the GitHub official website , select new repository , then configure as shown in the figure, and finally complete the creation
Git tools
Download address : https://git-for-windows.github.io/
Configure Git
After the installation is complete, open Git bash
and enter:
fill in your GitHub email in the middle
ssh-keygen -t rsa -C “[email protected]”
Enter all the way, do not set the password, enter the directory under C drive after the creation: The
id_rsa.pub file contains the key we need, copy it down
Open Github and
create a new SSH key
Building a local warehouse
Then you need to create a repository on the local disk:
then right-click and open Git Bash here
git clone https://github.com/xxxxxxxx
The following is the URL of the GitHub repository created before. After the
operation is completed, the folder will clone the existing folder
Deploy to Git repository
Then enter the cloned folder, right-click and open Git bash here
git init
After git init, a .git folder will be created and
then execute:
git add “项目名”
git commit -m “xxx” //这里是项目注释
(here in my git add ., some files have warnings, ignore them for the time being)
Possible problems 1
During the execution, you will be prompted to bind the email address or name of GitHub. Follow the prompt to bind and
then add the warehouse address on GitHub.
git remote add origin 你GitHub仓库网址
(My accelerator will have many sources, just choose the first one)
Possible problems 2
error: remote origin already exists
The remote origin already exists
. Execute the delete statement:
git remote rm origin
continue
git remote add origin 你GitHub仓库网址
Finally, associate this repository with the github repository and push the local repository:
git pull origin main
git push origin main
Check out the GitHub repository
Project deployment is successful! ! !