We are developing Go programs on a Git mono repository. To include dependencies, we do not use "go get". Instead, we import third party packages by using "git subtree".
For instance, github.com/BurntSushi/toml can be imported like this: git remote add -f toml https://github.com/BurntSushi/toml git subtree add -P go/src/github.com/BurntSushi/toml toml master --squash To update, just do: git fetch toml git subtree pull -P go/src/github.com/BurntSushi/toml toml master --squash This does not work for non-Git repositories, of course. 2016年11月13日日曜日 2時00分08秒 UTC+9 Nick Stogner: > > I would like to version control my entire GOPATH to store all of my go > code in a monolithic repository. (see http://danluu.com/monorepo/ or > https://blog.gopheracademy.com/advent-2015/go-in-a-monorepo/) > > The problem that I run into: how to manage dependencies with "go get" ?.. > I would like to vendor these dependencies but git wants to treat them as > nested repos and doesn't end up vendoring them on commit to the parent repo. > > I have tried: moving nested ".git" directories to ".git-moved", etc. This > works for vendoring go-gotten repos but is a hassle and also messes up > future calls to go get: > > $ mv src/github.com/Sirupsen/logrus/.git src/github.com/Sirupsen/ > logrus/.git-moved > $ git add --all; git commit -m 'this commit vendors the logrus package' > $ go get -u github.com/Sirupsen/logrus > package github.com/Sirupsen/logrus: directory "/tmp/monorepo/src/ > github.com/Sirupsen/logrus" is not using a known version control system > > I would have to mv those .git-moved directories back to .git before using > go-get again and this would be a pain and not scalable to a team. > > Has anyone come up with a solution for this? > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.