Git Server挫败(Gitosis,Gitolite等) [英] Git Server Frustration (Gitosis, Gitolite, etc)

查看:182
本文介绍了Git Server挫败(Gitosis,Gitolite等)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请原谅令人沮丧的意见,因为我试图多次正确地设置这个设置(可能和很可能是由于我的无知,但也可能是由于缺乏全面和简洁的文档)。



我正在设置一个git服务器,以便我可以在一小组开发人员之间共享代码。每个开发人员可以连接多台客户端PC。我过去来自MS,所以我对开发工具集 有些迷惑,但如果我可以得到类似于TFS的东西,那将是非常棒的。



当试图设置gitosis时(我明白这已经被git社区弃用了,每个 https://serverfault.com/questions/225495/ubuntu-server-gitosis-user-naming-convention )或gitolite,似乎尽快设置它,我必须非常注意,因为它看起来一切都在牙签上平衡。



我最近尝试建立一个git服务器,包括将我的公钥(benny.pub)从我的笔记本电脑移动到服务器,使用该公钥设置所有内容并拉下配置以设置回购和权限。然后我意识到我想在另一台电脑上开发,所以我创建了一个新的键(benny@desktop.pub),并将benny.pub重命名为benny@laptop.pub,这明显地将事情搞砸了。这是我知道我通过更改名称而变得愚蠢的原因。

我的问题在一个冗长的描述之后是这样的:我如何设置一个坚固的自托管git服务器能够让多个开发人员在保持安全性的同时从多台机器登录?必须有一个成熟的技术(gitolite描述了可能4-5种不同的方式......也令人沮丧)做到这一点,因为我确信我不是唯一一个试图完成同样事情的人。也许git不适合我的团队?



非常感谢任何帮助! 解决方案

根据我的经验,您所需要的只是一个带有单个 git帐户/登录名的SSH服务器,您可以使用其中一个公用密钥连接到该帐户。使用SSH安装gitolite(将gitloite从客户端复制到服务器并执行基本设置),并让开发人员向您发送公钥。将这些密钥添加到您的中的gitolite-admin存储库并推送。



为什么开发人员需要超过首先一个密钥对,即使使用多台机器?这种情况既不会影响SSH如何处理身份验证,也不会影响gitolite如何处理授权:它们仍然是SSH密钥。


  • 如果开发人员必须使用几个密钥对(一个用于git,另一个用于其他服务器),让他们处理复杂性并建议他们为他们使用的每个密钥对/服务器组合在〜/ .ssh / config 中创建一个条目。


  • 如果开发人员在每台机器上都有不同的密钥对,gitolite组可以组合几个公钥:






  @agross = agross-1 agross-2 


Please excuse the frustrating undertones as I have attempted to get this set up correctly multiple times to no avail (possibly and most likely due to my ignorance, but also likely due to the lack of thorough and concise documentation).

I am trying to set up a git server so that I can share code amongst a small team of developers. Each developer may connect from multiple client PC's. I come from MS in the past so I am a bit spoiled in regards to development toolset, but it would be awesome if I could get something similar to TFS.

When trying to set up either gitosis (I understand this is deprecated for the git community per https://serverfault.com/questions/225495/ubuntu-server-gitosis-user-naming-convention) or gitolite, it seems as though as soon as I set it up I have to be extremely careful because it seems everything is balancing on toothpicks.

My latest attempt to set up a git server included moving my public key (benny.pub) from my laptop to the server, setting everything using that public key and pulling down the config to set up a repo and permissions. I then realized I want to develop on another PC so I created a new key (benny@desktop.pub) and renamed benny.pub to benny@laptop.pub which screwed things up obviously. This is where I know I was dumb by changing the name.

My question after a long-winded description is this: how can I set up a sturdy self-hosted git server with the ability to have multiple developers log in from multiple machines while maintaining security, etc? There has to be a proven technique (gitolite describes maybe 4-5 different ways...also frustrating) to do this as I'm sure I'm not the only one trying to do this exact same thing. Maybe git isn't right for my team?

Any help is greatly appreciated!

解决方案

From my experience, all you need is a SSH server with a single git account/login that you are able to connect to using one of your public keys. Install gitolite using SSH (copies gitloite from your client to the server & does the basic setup) and have your developers send you their public keys. Add these keys to the gitolite-admin repository in your ~ and push.

Why does a developer need more than one keypair in the first place, even if multiple machines are used? Such cases will neither influence how SSH handles authentication nor how gitolite handles authorization: they're still SSH keys.

  • If a developer has to use several keypairs (one for git, another for some other server), let them handle the complexity and advise them to create an entry in ~/.ssh/config for each keypair/server combination they use.

  • If a developer has a different keypair on every machine used, gitolite groups can combine several public keys:

@agross = agross-1 agross-2

这篇关于Git Server挫败(Gitosis,Gitolite等)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆