Host on GitHub guide needs improvement

I have basic knowledge about git, Go, HTML, whatever

For the 3rd run I could publish a basic site on GHPages, following the official docs:

First time I initialized a local repo, but did not commit anything to master (following the Quickstart guide).
Then I created the new orphan gh-pages branch, and lost master branch. When I realized the fact, I restarted the whole thing again.

Second time I made a commit, then the git reset --hard threw a warning, because I have already added something into theme directory (following the Quickstart guide).* I restarted the whole thing again

Third time I made a commit (but did not add a theme), made the gh-pages orphan and then add some customization…
Meantime I read about what is an orphan branch :slight_smile:

Should I open an issue on GitHub?

*: I don’t know what caused the error
“warning: unable to rmdir themes/minimo: Directory not empty”
in this case

I use Forestry.io to host on GitHub … it works with both versions of Hugo (normal and extended) … unless your setup is complex, you don’t need to write a single shell script.

Forestry syncs with one branch of your repo and spits the generated site on another branch as per your specification.

It’s a good approach if you would consider it.

Not sure about your other issues, but this looks like you tried to delete a non-empty directory (folder) on Windows.

To do this, you need to pass the appropriate flags, so that the directory and all sub-directories are deleted:

rmdir /s/q <dir>

Thanks for your reply.

I will check Forestry but at first I would like to understand the basics, also I like the terminal :wink:

my original thought was: is it an issue in the docs or it’s just me who was not able to figure it out?

I was on Linux (bash), and git tried to remove something when I was running git reset --hard
the working tree was clean

Ah, gotcha – rmdir is a Windows command, so I guess it the error message wording threw me off.

Edit: @mojoa ha look at that, never knew about it since rm -rf met my needs.

1 Like


:slight_smile: