Created
June 17, 2020 10:12
-
-
Save arsperger/8c5cf74418246390dc9f9792d7f0151f to your computer and use it in GitHub Desktop.
How to import private go module from private gitlab repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 1 | |
# make git use SSH instead of HTTPS | |
git config --global url."git@gitlab.com:".insteadof="https://gitlab.com" | |
# or edit .gitconfig | |
[url "git@gitlab.com:"] insteadOf = https://gitlab.com | |
## 2 | |
# in gitlab repo and create access tocken | |
## 3 | |
# put access details to .netrc | |
machine gitlab.com gitlab+deploy-token-userID gitlab+deploy-token | |
## 4 | |
# go to go module dir and | |
go build | |
## reference: | |
https://docs.gitlab.com/ee/user/project/deploy_tokens/ 41 | |
https://docs.gitlab.com/ee/user/project/new_ci_build_permissions_model.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment