Git服务器像GitHub? [英] Git Server Like GitHub?
问题描述
我是一个很久以前会尝试Git的Subversion用户。我已经阅读了一些关于它的内容,并理解了分布式的本质 - 我可以看到很多好处。然而,我确实喜欢一个中央服务器的概念,它可以承担备份,记录系统等角色,同时仍然使用Git作为我的本地分支,分享。我没有做一个开源项目,所以我不能使用Github(没有付费),所以我的问题确实是:运行本地git服务器的最佳实践方式是什么?
我意识到这可能违背标准的Git使用模式,但它对我的项目很有用。但是,任何我可能忽略的问题总是受欢迎的。
谢谢!
- 在某处放置存储库(
/ var / gitroot $ c
)
- 创建一个新的回购(
/var/gitroot/project.git& cd projectmkdir project.git&& cd project.git&& git init --bare然后在你的客户端上,克隆远程仓库(
git clone ssh://yourserver.com) -
- 创建一个新的回购(
- 添加一些文件(
git add README $ c
- 提交(
git commit -m初始导入
),
- 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.
- Find somewhere to put the repository (
/var/gitroot
for example). - Create a new repo (
mkdir project.git && cd project.git && git init --bare --shared=group
). - Then on your client, clone the remote repo (
git clone ssh://yourserver.com/var/gitroot/project.git && cd project
) - add some files (
git add README
) - commit (
git commit -m "Initial import"
), - push (
git push origin master
)
This should set things up for you.
这篇关于Git服务器像GitHub?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!