方法1. 通过https方法:https://golang.github.io/dep/docs/FAQ.html (CI部署)
方法2. 通过ssh方法:假定你已经上传本地ssh公钥,并保存到gitlab账户管理里面。(推荐)
$ git config --global url."ssh://[email protected]:2222/".insteadOf "https://git.5th.im/"
$ cat ~/.gitconfig
# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
name = suyanlong
email = [email protected]
[url "ssh://[email protected]:2222/"]
insteadOf = https://git.5th.im/
$ glide --version
glide version 0.13.2
在项目root目录下下运行:glide init 命令,生成glide.yaml文件,修改自己公司引用的依赖�package并修改ssh� git clone方式。glide.yaml内容片断例如:
...
- package: github.com/5thwork/rpc-protos
subpackages:
- shiralee
...
修改如下:
...
- package: github.com/5thwork/rpc-protos
repo: ssh://[email protected]:2222/core-team/rpc-protos.git
vcs: git
subpackages:
- shiralee
...