0

I want to use go get with a project hosted on private Bitbucket cloud. I have ssh configured so that the following works without manually entering credentials:

git clone git@bitbucket.org:<team-name>/<repo-name>.git

The following attempts don't work:

go get bitbucket.org/<team-name>/<repo-name>
go get bitbucket.org/<team-name>/<repo-name>.git
go get bitbucket.org:<team-name>/<repo-name>
go get bitbucket.org:<team-name>/<repo-name>.git

Here (https://community.atlassian.com/t5/Answers-Developer-Questions/go-get-and-bitbucket/qaq-p/565640), back in 2016, an Atlassian team member explains go get support for Bitbucket Server, but not Bitbucket Cloud.

clay
  • 18,138
  • 28
  • 107
  • 192
  • Hi Clay, what is the error message you're getting? – Eduardo Hitek Jun 25 '19 at 18:41
  • Wild ass guess - git protocol is ok, http protocol is not (go get is going to use http protocol iirc) – Slabgorb Jun 25 '19 at 18:42
  • With the first most obvious `go get bitbucket.org// ` I get `go: missing Mercurial command. See https://golang.org/s/gogetcmd`. This is a git repository, we are not using Mercurial at all, I'm not sure why the tool suspects that this is a Mercurial repository. – clay Jun 25 '19 at 18:43
  • 2
    Old versions of Go believe (correctly for the time) that bitbucket.org hosts only Mercurial repositories. Newer versions of Go believe that bitbucket.org hosts both Git and Mercurial repositories, but I'm not sure how you tell it which one. `go help importpath` suggests sticking the VCS into the path: `example.org/user/foo.hg` vs `example.org/repo.git/foo/bar` for instance. Go also tries http/https and looks for `` tags. If Bitbucket Cloud should provide a Git vcs tag here, that would presumably direct `go get` to use Git. – torek Jun 26 '19 at 02:10

0 Answers0