如何从github服务器在我的服务器上创建一个git存储库? [英] How to create a git repository on my server from the github server?

查看:136
本文介绍了如何从github服务器在我的服务器上创建一个git存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我承认这个问题不是很清楚。

我克隆了一个github托管的项目(askbot)。
我想要为此项目创建我的私人存储库,以便我的团队成员可以进行修改。
$ b


我也希望能够从原始
github存储库中获取(或者拉出)新的更新(项目将会有新功能和错误修复以及
等)

总之,我想要一个我们可以私下推/拉的存储库而且我们也可以从原始的github仓库中提取。

是否需要特殊设置? git clone 会创建一个完整的存储库。你可以在它上面工作,从中取出并推送更改。



唯一的问题是,你无法推送到当前检出的分支。为了解决这个问题,你可以设置一个 - bare 仓库,它没有检出分支。



必须决定,如何访问您的存储库。你可以使用ssh,git-daemon或gitolite等包装。



在你的工作副本上,你可以设置两个远程。一个用于上游,一个用于您的克隆。

这允许您从上游获取更新,将它们合并到您自己的工作中,并将其推回到您的克隆中。



因此:


  • 决定将您的私有存储库放在哪里以及如何访问它

  • 使用 git clone --bare $ upsteam 创建私有存储库

  • 克隆私有存储库的工作副本,创建远程源

  • 使用 git remote add 添加另一个远程上游
  • 玩得开心


I admit the question isn't crystal clear..

I am cloning a github hosted project(askbot).
I want to create my private repository for this project so that my team members can make modifications.

I also want to be able to fetch(or pull) new updates from the original github repository(the project will have new features and bug fixes and so on)

In short, I want a repository that we can push/pull privately and that we can also pull from the original github repository.
Are there special setup needed for this?

解决方案

git clone will create a full fledged repository. you can work at it, pull from it and push changes to it.

The only problem is, that you cannot push to the currently checked out branch. To solve this you can set up a --bare repository, which has no branch checked out.

You also have to decide, how to access you repository. You can use ssh, git-daemon, or a wrapper like gitolite.

On your working copy you can set up two remotes. One for the upstream and one you your clone.
This allows you to fetch updates from upstream, merge them in your own work, and push it back to your clone.

Hence:

  • decide where to put your private repository and how to access it
  • use git clone --bare $upsteam to create the private repository
  • Clone your working copy for the private repository, creating remote "origin"
  • use git remote add to add another remote "upstream"
  • have fun

这篇关于如何从github服务器在我的服务器上创建一个git存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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