简体   繁体   中英

Using go language with gitolite

Does know how to use Google's go languages clever get command with Gitolite? It works great with Google Code and Github as follows:

go get code.google.com/p/go.example/hello

or

go get github.com/alphazero/Go-Redis

But my gitolite access look more like:

git clone git@mygitolite:myproject

Any suggestions?

It has nothing to do with gitolite.
Gitolite is just an authorization layer , which will accept or deny your git clone/push/pull command, depending on your username.

If you can declare a git repo as a source for go, you can use it.
Gitolite will just check who you are, but won't otherwise affect how that repo is used with go.


The 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?

I don't think you need to transform anything: if go is able to contact your git repo (GitHub or any other hosting repo server), gitolite will intercept the command and validate it (or deny it).
You can plug gitolite on top of ssh or (as it is the case with git request done by go import) with https.

But the main point is:

  • gitolite is on the server side
  • you should use it with an Apache sever (like, for instance, with my config ), and not ssh, if you want to easily have your repos accessed with go imports.

I wrote a tool just for this use-case. See if it helps.

https://github.com/tuxychandru/gorepos

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM