【发布时间】:2019-03-25 08:28:41
【问题描述】:
我在 golang 中使用第三方包,我想将它们添加到我的 git 存储库中,当我输入命令 git add . 时,它给了我以下错误
warning: adding embedded git repository: github.com/beorn7/perks
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
hint: If you meant to add a submodule, use:
hint:
hint: git submodule add <url> github.com/beorn7/perks
hint:
hint: If you added this path by mistake, you can remove it from the
hint: index with:
hint:
hint: git rm --cached github.com/beorn7/perks
hint:
如何确保我对软件包进行了正确的版本控制以及我是否以正确的方式对我的第三方软件包进行版本控制?
这是我的项目结构
Project/
|
src/
|
github.com/
|
packages/
我的 GOPATH 也指向项目目录
【问题讨论】:
-
使用标准的
go dep工具。不要与工具作斗争。