Git服务器像GitHub? [英] Git Server Like GitHub?

查看:91
本文介绍了Git服务器像GitHub?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个很久以前会尝试Git的Subversion用户。我已经阅读了一些关于它的内容,并理解了分布式的本质 - 我可以看到很多好处。然而,我确实喜欢一个中央服务器的概念,它可以承担备份,记录系统等角色,同时仍然使用Git作为我的本地分支,分享。我没有做一个开源项目,所以我不能使用Github(没有付费),所以我的问题确实是:运行本地git服务器的最佳实践方式是什么?



我意识到这可能违背标准的Git使用模式,但它对我的项目很有用。但是,任何我可能忽略的问题总是受欢迎的。



谢谢!

解决方案

你可以设置一个ssh服务器并在那里运行一个中央仓库。然后,所有开发人员在完成提交时都会同意(作为策略)推送到服务器。这是我工作场所的使用模式。非常类似于CVS和SVN。


  1. 在某处放置存储库( / var / gitroot
  2. 创建一个新的回购( mkdir project.git&& cd project.git&& git init --bare然后在你的客户端上,克隆远程仓库( git clone ssh://yourserver.com) -
  3. /var/gitroot/project.git& cd project
  4. 添加一些文件( git add README

  5. 提交( git commit -m初始导入),

  6. push( git push origin master

你。


I am a long time Subversion user that is going to try Git. I have read some about it and understand the distributed nature - I can see a lot of the benefits.

However, I do like the idea of a central server that can take on the role of backups, system of record, etc, while still using Git for my local branching and sharing. I am not doing an open source project, so I can't use Github (without paying), so my question really is: what is a best practice way to run a local git server?

I realize this may be against the standard Git usage pattern, but it will be useful for my project. Any concerns that I may have overlooked are always welcome, however.

Thanks!

解决方案

You can just set up an ssh server and run a central repository there. All developers then simply agree (as a matter of policy) to push to the server when they are done making commits. This is the usage pattern at my workplace. Very CVS and SVN-like.

  1. Find somewhere to put the repository (/var/gitroot for example).
  2. Create a new repo (mkdir project.git && cd project.git && git init --bare --shared=group).
  3. Then on your client, clone the remote repo (git clone ssh://yourserver.com/var/gitroot/project.git && cd project)
  4. add some files (git add README)
  5. commit (git commit -m "Initial import"),
  6. push (git push origin master)

This should set things up for you.

这篇关于Git服务器像GitHub?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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