I've read a few tickets on Github about this issue, but was anyone able to make it work somehow? I'm trying to use go dep for some internal packages but it always fail / get stuck...
评论:
colek42:
zelenin:in your .gitconfig use the "insteadof" directive and always use ssh
# Enforce SSH [url "ssh://git@github.com/"] insteadOf = https://github.com/ [url "ssh://git@gitlab.com/"] insteadOf = https://gitlab.com/ [url "ssh://git@bitbucket.org/"] insteadOf = https://bitbucket.org/
Thaxll:gogs/gitea with custom ssh port:
[url "ssh://git@git.domain.com:10022/"] insteadOf = https://git.domain.com/
condanky:This what I have but for some reason the git CLI is stuck during git ls-remote / git-upload-pack ... :/
Thaxll:Hey, what I have done is created a constraint in the .toml file and set the repo source with a github token. For example
https://
That way dep will be able to download the repo. I haven't experimented with using a ssh key though.@github.com/owner/repo.git
PurplrGecko:Unfortunately it's not for github :/ This issue only applies for stash / gitlab / bitbucket
d1mk0:https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md#constraint
dep use installed git tool to download dependencies
As @PurpleGecko mentioned it's using local git command.
What I've done is setup ssh-agent and added ssh key. Then go dep/get worked just fine for me. For example if you have ssh key in ~/.ssh/private-repo then:
$ ssh-add ~/.ssh/private-repo
Also, if you do it in the docker and you can't interact with console then you would need to add host to known_hosts before adding key. Below is example for bitbucket.
$ ssh-keyscan bitbucket.org >> ~/.ssh/known_hosts
