I have a Go project that requires some dependencies from a private GitLab repository like git.mydomain.com/myteam/category/subcategory/project.git.
But I'm getting this error.
ensure Solve(): remote repository at https://git.mydomain.com/myteam/category.git does not exist or is inaccessible: : exit status 128
This issue is discussed at length on the GitLab support tracker.
TL;DR; It's (intentionally) broken for private repos:
The only solution I've found is to use
go get's support for.netrc, which solves this both fordep, as well as modern Go modules.Create a Personal Access token on GitLab with api scope:
Create a
~/.netrcfile:Protect your
.netrcfile a bit:Profit
This should now work:
or
If you're using a private GitLab installation, I trust you to replace
gitlab.comwith the appropriate hostname where applicable.