According to this instruction, I entered the following into git,
git submodule add -b master https://github.com/<USERNAME>/<USERNAME>.github.io.git public
but 'public' does not have a commit checked out
appears as result.
I am quite new to this field, so I need explanations on some basic things. What exactly needs to be done with the public
directory, and what should I do to solve this error?
The link you provided shows you how to keep hugo files and the generated website files separated in different repos, i.e. the code in github.com/username/blog and website in github.com/username/username.github.io.
I feel that all this seems too complicated to you. The simplest way to serve a hugo website is by using only one repository. Just follow this: