GIT支持镜像或代理概念吗? [英] Does GIT supports mirroring or proxy concept?

查看:106
本文介绍了GIT支持镜像或代理概念吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是GIT环境的新手,非常友善:)
在我们的项目中,我们计划从RTC转移到GIT,代码通过ftp作为tar包共享。
棘手的情况是,我们在两个不同的地方都有我们的办公室。我们将在位置A创建一个GIT服务器,并完成代码迁移/导入@ A,然后设置一个确切的设置@ B,然后将A同步到B的GIT环境。 (镜像A到B并使B成为主)。这种方法是否可行?如果是这样,在这个过程中,我们应该采取什么样的预防措施,如权限问题等(我明白,它不服务GIT的DVCS目的,但仍然想知道)



另外,如果上述方法可行,是否可以通过GitLab执行?



谢谢!

解决方案

太长了,所以在这里。



Git基本上是一个分布式系统,其中的变化是 push -ed和 pull -ed存储库之间。每个签出或克隆都是整个存储库的副本,并不存在像'中央存储库'这样的东西。至多有一个关于哪个存储库是中心的协议。

首先建立一个空的GitLab存储库A.
然后克隆它进入工作环境W: git clone git@gitlab.localnet:path / to / repo.git (gitlab解释了这个),
,或者,可以创建一个新的本地存储库,并添加远程设备:

  mkdir W&& cd W 
git init
git remote add git@gitlab.localnet:path / to / repo.git
git pull

然后添加tarball中的文件, commit (到W)和 push 它回到你的gitlab实例A.



如果你想同步到站点B,你可以使用同一个仓库W,并注册一个第二个远程仓库B( git remote add B git @ .... )。
您可以简单地 git push B



总之,您需要第三个工作仓库, - 从A和 push - >将它们更改为B.



我对RTC并不熟悉,但我还有其他几个人,比如Subversion,它允许您指定存储库任何部分(甚至分支机构)的读/写权限。但Git没有权限系统。您可以使用GitLab在每个存储库级别配置它。
这意味着,如果您的RTC权限方案在每个项目的基础上包含不同权限,您现在必须为每个项目创建一个单独的存储库。



这里有很多内容,所以我可以推荐在进行这种转换之前花一些时间阅读文档。


I'm new to GIT environment, so kindly bear with me :) In our project we are planning to move to GIT from RTC , and the code is shared as a tarball via ftp. The tricky situation is , we are having our office at 2 different places . we will create a GIT server , say at location A and complete the code migration/import @ A and later setup an exact setup @ B and subsequently synchronizing A to B’s GIT environment. (mirroring A to B and making B as master) . Is this approach feasible ? if so, during the process what are precautions we should incorporate like permission issues etc.(I understand , it doesn’t server the DVCS purpose of GIT, but still , like to know )

Also, if the above approach if possible , can it be executed via GitLab ?

Thanks!

解决方案

I'd comment but the explanation is too long, so here goes.

Git is basically a distributed system, where changes are push-ed and pull-ed between repositories. Every 'checkout' or 'clone' is a copy of the entire repository, and there isn't really such a thing as the 'central repository'. At best there is an agreement as to which repository is central.

First you set up an empty GitLab repository A. You then clone it into a working environment W: git clone git@gitlab.localnet:path/to/repo.git (gitlab explains this), or, alteratively, create a new local repository, and add the remote:

    mkdir W && cd W
    git init
    git remote add A git@gitlab.localnet:path/to/repo.git
    git pull

You then add the files from your tarball, commit (to W), and push it back to your gitlab instance A.

If you want to sync to site B, you could use that same repository W, and register a second remote repository B (git remote add B git@....). You can then simply git push B.

In short, you'll need a third working repository, pull-ing the changes from A and push-ing them to B.

I'm not familiar with RTC, but I am with several others, such as Subversion, which allows you to specify read/write permissions on any part of a repository (even branches). Git however does not have a permission system. You'd configure that on a per-repository level using GitLab. This means, that if your RTC permission scheme includes different permissions on a per project basis, you will now have to create a separate repository for each project.

There are a lot of ins and outs to this so I can recommend spending some time with the documentation before making such a transition.

这篇关于GIT支持镜像或代理概念吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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