Hi,
I have been following the directions for pushing a hugo site to Github gh-pages and then adding a custom domain to it. However, the directions seem to be wrong. This is what I am talking about specifically:
Building and Deployment
Now check out the gh-pages branch into your public folder, using git’s worktree feature (essentially, it allows you to have multiple branches of the same local repo to be checked out in different directories):
rm -rf public
git worktree add -B gh-pages public upstream/gh-pages
So I am successful in creating a gh-pages, but nothing actually gets pushed there. It remains an orphan empty branch. My ultimate goal is to take my newly created hugo static site that was originally (and technically still is until I successfully complete pointing my domain to gh-pages) on WP and host it on gh-pages via Hugo. Anyone else have similar issues?
For example:
git worktree add -B gh-pages public upstream/ gh-pages
usage: git worktree add [<options>] <path> [<branch>]
or: git worktree list [<options>]
or: git worktree lock [<options>] <path>
or: git worktree prune [<options>]
or: git worktree unlock <path>
-f, --force checkout <branch> even if already checked out in other worktree
-b <branch> create a new branch
-B <branch> create or reset a branch
--detach detach HEAD at named commit
--checkout populate the new working tree
Update: I found the following thread which has half-gotten me there (so far): https://discuss.gohugo.io/t/simple-deployment-to-gh-pages/5003
Update: I am having trouble with “upstream” part:
git push upstream gh-pages
fatal: 'upstream' does not appear to be a git repository
fatal: Could not read from remote repository.