Make a personal academic website (home page) based on github

template

First find an academic template and fork it to a remote repository. academicpages , if you are not very clear about the specific steps, you can refer to the nanny-level tutorial . It is not very convenient to modify the code of this website on github. It must be updated locally and then pushed to the remote warehouse.

local Git

Just learn how to download and install. You can default all the way. You can learn the principles and basic operations of Git first. You can refer to the simplest GitHub tutorial in the history of this blog .
After installation, create an empty folder to be used as a local warehouse.
Right click on the folder to open git.

git config --global user.email "[email protected]"
git config --global user.name "Your Name"

Configure the email address and username of github.
The fork project can then be cloned into this folder:
insert image description here

git clone https://github.com/guobinhit/mybatis-tutorial.git

(replace this link with your own)

Use SSH to complete the binding of Git and GitHub

The following is to bind the local GIt and github.
enter

ssh-keygen -t rsa

It means that we specify the RSA algorithm to generate the key, and then press the Enter key three times. During this period, no password is required, and then two files will be generated, namely id_rsa and id_rsa.pub, namely the key id_rsa and the public key id_rsa.pub. For these two files, they are hidden files, which are generated in the following directory by default:
Windows system: C:\Documents and Settings\username\.ssh
Find it yourself, in the username of drive C: This is my screenshot.
insert image description here
After the key and public key are generated, what we need to do is to add the content of the public key id_rsa.pub to GitHub, so that our local key id_rsa and the public key id_rsa.pub on GitHub can be matched. After the authorization is successful , you can submit code to GitHub!
Open and copy id_rsa.pub with Notepad, enter our GitHub homepage, enter the Settings page, click SSH and GPG Keys to enter this sub-interface, and then click the New SSH key button, you only need to copy the content of the public key id_rsa.pub Paste it to the position of the Key (it’s okay if you don’t fill in the content of Titles), and then click Add SSH key.

Verify that the bind was successful
by typing in Git Bash

ssh -T [email protected]

Test:
insert image description here
This result is a sign that the binding between Git and GitHub is successful.

Modify as needed and update locally and remotely

All the files in the cloned warehouse can be changed to your own content according to your own needs.
insert image description here
Since we belong to, first of all, there is no Git warehouse locally, at this time we directly clone the remote warehouse to the local. The local warehouse created by the clone command is itself a Git warehouse. We don't need to perform init initialization operations, and it is automatically associated with the remote warehouse. We only need to modify or add operations in this warehouse, and then commit.
For example, if _pages/about.md, _config.yml and navigation.yml have been changed,
enter the git status command to view the status of the warehouse:

git status

insert image description here
Show it changed!
Before actually submitting the code, you need to perform the git add operation first:
insert image description here
the changed files must be git add operated
insert image description here
and committed to the warehouse .
Enter the git status command to view the warehouse status:
insert image description here
Next, we will push the contents of the local warehouse to the remote warehouse and enter git push origin master command:
insert image description here
refresh the github interface, and you will find that it has been submitted to the remote warehouse.
insert image description here

Wait for a while, refresh the page, and you will find that the content has been updated!

Guess you like

Origin blog.csdn.net/weixin_43835470/article/details/131604553