如何让开发人员(自由职业者)只能访问我们的 BITBUCKET 中的一个文件夹?

How to give a developer (freelance) access to only one folder in our BITBUCKET?

我们想与一位新开发人员合作,我们不想立即向他展示所有代码。这就是我们今天的工作方式:

  1. 本地GIT
  2. 推送到 BITBUCKET
  3. 自动推送到 AWS EB(我们的测试服务器)。

现在我们想和他这样合作:

  1. 他只能访问 BITBUCKET 中的一个文件夹(我们知道他们不提供此选项。
  2. 他可以将 BITBUCKET 推送到我们授予他访问权限的文件夹。
  3. 将自动推送到 AWS 测试服务器。

知道我们该如何解决吗?也许有更好的软件可以帮助我们?

谢谢

您无法控制对 git 中文件夹的访问。在像 svn 这样的其他 vcs 中,你可以。所以你可以做的是创建一个 git 子模块。并授予对该子模块存储库的访问权限。

首先创建一个仅包含您的新文件夹的新存储库。(子模块)

git clone repo newfolder
cd newfolder
git filter-branch --subdirectory-filter 'path to the folder that need to be added as submodule' --prune-empty -- --all
git remote rm origin
git remote add newgitrepoin.bitbucket

现在在原始仓库中:

git rm 'path to the folder to be added as submodule'
git commit
git submodule add newgitrepoin.bitbucket "path to folder deleted above"
git submodule init
git submodule update
git add .gitmodules "path to folder deleted above"
git commit