英文:
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;
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论