how to 'go get' files in a different branch in github repo other than master

huangapple go评论79阅读模式
英文:

how to 'go get' files in a different branch in github repo other than master

问题

我需要从这个仓库中使用go get命令获取以下文件:

go get github.com/mattes/migrate/driver/mysql

但是这些文件位于一个不同的分支,而不是master分支。我该如何使用go get命令获取这些文件?我尝试了以下方法,但没有获取到我需要的文件。

go get gopkg.in/mattes/migrate.v1

感谢任何帮助。

英文:

I need to go get following files from this repo

go get github.com/mattes/migrate/driver/mysql

but those files are in a different branch, not in master. How can I go get those files? I tried following way but it didn't get those files that I need.

go get gopkg.in/mattes/migrate.v1

Appreciate any help.

答案1

得分: 0

这不支持go get,你需要手动将文件下载到你的GOPATH或者vendor/文件夹中。

一个供应商解决方案:

git clone git@github.com:mattes/migrate.git
    vendor/github.com/mattes/migrate;
cd vendor/github.com/mattes/migrate;
git checkout BRANCH_NAME;
英文:

This is not supported by go get, you need to download the files manually to your GOPATH or to your vendor/ folder.

A vendor solution:

git clone git@github.com:mattes/migrate.git
    vendor/github.com/mattes/migrate;
cd vendor/github.com/mattes/migrate;
git checkout BRANCH_NAME;

huangapple
  • 本文由 发表于 2017年7月10日 19:17:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/45010627.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定