1

I'm trying to go get a private Bitbucket package. But when doing so, I receive the following error message:

go: bitbucket.org/project/package: reading https://api.bitbucket.org/2.0/repositories/project/package?fields=scm: 403 Forbidden
    server response: Access denied. You must have write or admin access.

I tried to set git config --global url."git@bitbucket.org:".insteadOf "https://bitbucket.org/", in combination with go env -w GOPRIVATE=bitbucket.org/project. but that didn't work.

So I tried setting git config --system url."git@bitbucket.org:".insteadOf "https://bitbucket.org/". that didn't work either.

Finally I tried setting GOPRIVATE manually by writing export GOPRIVATE=bitbucket.org/project in ~/.bashrc. didn't work.

Important to know that I've confirmed that SSH is working correctly by pulling/pushing code from/to private repos.

  • Have a look at this thread [go get - 403 SO](https://stackoverflow.com/questions/63791976/go-get-private-bitbucket-repo-giving-403-forbidden). It might give a clue. – jemaltahir Oct 10 '21 at 11:26
  • When you say “that didn't work” — what commands did you run, and what errors did you see from those commands? – bcmills Oct 20 '21 at 18:22

0 Answers0