[英]How to create a git repository on my server from the github server?
I admit the question isn't crystal clear.. 我承认这个问题不清楚。
I am cloning a github hosted project(askbot). 我正在克隆一个github托管项目(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)
我还希望能够从原始github存储库中获取(或提取)新更新(该项目将具有新功能和错误修复等)
In short, I want a repository that we can push/pull privately and that we can also pull from the original github repository. 简而言之,我想要一个存储库,我们可以私下推/拉,也可以从原始的github存储库中提取。
Are there special setup needed for this? 是否需要为此进行特殊设置?
git clone
will create a full fledged repository. git clone
将创建完整的存储库。 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. 为了解决这个问题,您可以设置
--bare
存储库,该存储库没有签出任何分支。
You also have to decide, how to access you repository. 您还必须决定如何访问存储库。 You can use ssh, git-daemon, or a wrapper like gitolite.
您可以使用ssh,git-daemon或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: 因此:
git clone --bare $upsteam
to create the private repository git clone --bare $upsteam
创建私有存储库 git remote add
to add another remote "upstream" git remote add
添加另一个远程“上游”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.