限制用户访问特定的git分支回购和历史回购,同时保留合并功能


  • 这是我的背景:

    1. 我有一个有20个版本的软件,每个版本代表(相同)我的git repo中的一个分支
    2. 我有两个团队,一个是本地团队,另一个是远程团队
  • 以下是我的限制:

    1. 本地团队可以完全访问回购
    2. 远程团队只能访问第15个版本(第15个分支)
    3. 雷莫团队在第15分支之前无法访问历史
    4. 远程团队无法访问本地tema工作
    5. 远程团队只能访问他们的工作
  • 这里有一个前提:

    1. 如果本地团队能够从远程团队代码中进行合并,并将冲突痛苦降至最低,那将是非常棒的
  • 我试过什么?

    1. 第1次我从回购中创建了一个分叉,我保证大师只有第15个版本。一些masrter和第15分支是一些代码版本。该解决方案中的问题是:远程团队仍然可以访问所有回购、历史记录和代码。

    2. 第2次从第15家分行开始创建新的回购。在这种情况下,问题在于本地团队何时从远程代码团队合并到本地代码团队。

到目前为止,我会选择第2个选项,即使我有合并问题。

那么,有人有更好或更优雅的解决方案吗?

真的希望让我自我解释。

=========================================

我执行了以下命令:

git clone--mirror--depth 1--branch release/v15https://carlotto_totem@bitbucket.org/old_repo.git

cd old_repo

git-push—镜像https://carlotto_totem@bitbucket.org/new_repo.git

然后我得到了这个消息:

C:old_repo>git push --mirror https://carlotto_totem@bitbucket.org/new_repo.git
Password for 'https://carlotto_totem@bitbucket.org':
Counting objects: 131, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (95/95), done.
Writing objects: 100% (131/131), 9.72 MiB | 238.00 KiB/s, done.
Total 131 (delta 28), reused 131 (delta 28)
To https://carlotto_totem@bitbucket.org/new_repo.git
 ! [remote rejected] release/v15 -> release/v15 (shallow update not allowed)
error: failed to push some refs to 'https://carlotto_totem@bitbucket.org/new_repo.git'

我该怎么办?

不允许浅层更新

做一个浅层克隆,这样你就只能回到第15个版本。然后将其推送到一个新的裸存储库。只允许远程团队访问该新存储库。本地团队应该能够从中提取作为第二个远程,并从远程合并到本地。

最新更新