Git Commands in Usage

Overview

git_structure.png

Update website

Using Hugo to set personal website has some issues about Git to attention. Source code and website code are independent.

Category Source code Website Code
Creation Manually Automatically
File type .md .html
Usage Edit the Content Display the Information
Folder hugo root public

Therefore, we need to develop the source code firstly, and push it to git. Then, refresh the public folder to update the blog website. The steps are as follows.

  • Git push Blog source
  • Create public folder
  • Operate the following commands:
cd public
git clone https://github.com/:github_account/:git_repository ./
cd ..
hugo
cd public
git add .
git commit -m 'update blog'
git push

Don’t forget the ./ in the second command. Otherwise, the public will have one folder rather than all code library