知道如何使用Google的go语言巧妙地使用Gitolite获取命令吗? 它与 Google Code 和 Github 配合得很好,如下所示:
go get code.google.com/p/go.example/hello
或
go get github.com/alphazero/Go-Redis
但我的 gitolite 访问看起来更像是:
git clone git@mygitolite:myproject
有什么建议吗?
最佳答案
与gitolite无关。
Gitolite 只是一个 authorization layer ,它将接受或拒绝您的 git clone/push/pull
命令,具体取决于您的用户名。
如果您可以将 git 存储库声明为 go 的源,则可以使用它。
Gitolite 只会检查您是谁,但不会影响该存储库与 go 的使用方式。
OP Peter Krnjevic refines the issue :
The thing with go, is that it pulls the repo name from the directory structure, so for instance:
~/gocode/src/github.com/me/myproject
is automagically transformed into
git clone github.com/me/myproject.
But how can gitolite names be transformed into a path?
我认为你不需要改变任何东西:如果 go 能够联系你的 git 存储库(GitHub 或任何其他托管存储库服务器),gitolite 将拦截该命令并验证它(或拒绝它)。
您可以将 gitolite 插入到 ssh 之上或使用 https(就像通过 go import 完成的 git 请求的情况一样)。
但 Gist 是:
- gitolite 在服务器端
- 如果您想通过 go 导入轻松访问您的存储库,您应该将其与 Apache 服务器(例如 with my config )一起使用,而不是 ssh。
关于git - 使用 go 语言与 gitolite,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14636150/