Problems deploying to github

Hi

I’m trying deploy my Hugo site using the instructions here:

https://gohugo.io/hosting-and-deployment/hosting-on-github/#step-by-step-instructions

I developed the site on one PC and uploaded the files to github so that I could pull them down on another PC and continue working on them. Now I wish to publish the site.

I have tried to issue the following command:

git submodule add -b master git@github.com:<USERNAME>/<USERNAME>.github.io.git public

By substituting my relevant info:

git submodule add -b master git@github.com:canstream/canstream.github.io.git public

But I get the following error:

Cloning into '/home/user/mysite/2019-conference/public'... git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists. fatal: clone of 'git@github.com:canstream/canstream.github.io.git' into submodule path '/home/user/mysite/2019-conference/public' failed

For information, I have no ‘public’ folder - when I ran hugo it created a sub-directory as follows: canstream.github.io which contains files (html, css, js etc) for the website.

My directory structure looks a little like this:

$pwd
/home/user/mysite/2019-conference

$ls .

archetypes canstream.github.io CNAME config.toml config.toml.ORIGINAL content README.md resources themes

Should I run the following command:

git submodule add -b master git@github.com:canstream/canstream.github.io.git canstream.github.io

Many thanks in advance.

It appears that:

  • your GitHub repo is private
  • you have not configured your machine with a GitHub access token so that it may clone the repo.

Because canstream.github.io must be public to be available as GitHub pages, you should make this change on GitHub and you should then also be able to clone the repo without issue.

1 Like