I have a private Hugo theme repository on GitHub that multiple sites share which has been working well before recent updates.
So far I have been able to do this by replacing the git URL in my git config locally, along with running a script to do this on CloudCannon:
This has worked well up until v0.91.2. Now when I run hugo mod get -u within my site directory I get the following error:
go get: module github.com/USER/THEME: git ls-remote -q origin in /var/folders/26/gqnv01_55p964v8yz39d51fw0000gn/T/hugo_cache/modules/filecache/modules/pkg/mod/cache/vcs/235a1e682f371746744c788f5c36ac403a23b2815ffad84f6aa83fecb0af34e7: exit status 128:
remote: Repository not found.
fatal: repository 'https://github.com/USER/THEME/' not found
Is this a bug or is there a better way to use private theme repositories now?
What does git remote -v tell you? If it’s a http-link, then switch your remote to SSH and authenticate Github with a key.
This SSH key authentication thingy is not Hugo related, Hugo just uses it.
Access Github via SSH is in general always better. In my opinion.
PS: Change remote via:
git remote set-url <remote_name> <remote_url>
Where remote_name is most times origin, if not, you know what it is And remote URL is what you can copy when you check the clone button on your github repo and select the SSH option. Something like git+ssh://github@github.com/username/reponame.git.