-1

I am trying to import a private gitlab repository into my Go code. I want to use the user access token for authentication. Is there a way in which I could pass the access token in the import command.

I tried using the basic oauth2 url in the import command, but the import command only accepts a path.

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
AS-Sher
  • 384
  • 1
  • 4
  • 18

1 Answers1

1

You can run command

git config --global url.git@gitlab.com:.insteadOf https://gitlab.com/

and try again, it'll use your git credential to work with gitlab.

For example, your repository is located at https://gitlab.com/yourname/hello

you run

go get gitlab.com/yourname/hello
tony
  • 71
  • 1
  • 2