清理外部承包商的汞库 [英] Cleaning up a mercurial repository for an external contractor

查看:94
本文介绍了清理外部承包商的汞库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个活跃的项目,其中包含一些敏感的文件和目录.我想聘请外部承包商来做一些简单的UI工作.但是,我不希望承包商能够访问某些目录和文件.我的项目是在Bitbucket上进行的.

I have an active project with some sensitive files and directories. I want to hire an external contractor to do some simple UI work. However, I don't want the contractor to have access to some directories and files. My project is in mercurial on Bitbucket.

清理项目并使他能够提交更改的最佳方法是什么?我曾考虑过分叉到一个新的存储库中,但是我担心删除不希望他访问的目录.

What is the best way to clean up the project and give him access to commit his changes? I thought about forking into a new repository, but I am worried about removing directories I don't want him to have access to.

如何删除它们,使它们不显示原始变更集?如何在不删除主存储库中的那些目录的情况下将他的存储库合并回去?叉子能走吗?

How to I remove them so they don't appear the original changesets? How to I merge his repo back without it removing those directories in my main repository? Is a fork the way to go?

推荐答案

自然地,存储库需要访问其整个历史记录以自检其完整性.我不知道有选择地隐藏存储库部分的方法(有 ACL扩展,但这仅适用于写访问.

Naturally a repository needs access to its whole history in order to self-check its integrity. I don't know of a way to selectively hide parts of the repository (there's the ACL extension, but it is for write access only).

在你的情况下,我会

  1. 创建一个剥离了所有敏感信息的新存储库(使用转换扩展名该任务).
  2. 然后,我将让外部人员处理该存储库.
  3. 完成工作后,将其存储库拉入原始存储库的克隆中(使用-f强制拉出不相关的存储库),并且
  4. 重新设置他的第一个变更集及其所有子集到您原始存储库的头部.
  5. li>
  6. 最后,将重新定位的头部推到原始存储库中.
  1. create a new repository where all sensitive information has been stripped off (use the convert extension for that task).
  2. Then I would let the external guy work with that repository.
  3. Once his work is finsihed, pull his repository into a clone of the original one (using -f to force pulling of an unrelated repository), and
  4. rebase his first changeset and all its children onto a head of your original repository.
  5. Finally, push the rebased head to the original repository.

对于第3步到第5步,您不必等待外部开发人员完成.也可以重新建立他的存储库的中间状态.

For steps 3 to 5 you don't necessarily have to wait until the external developer is done. Rebasing intermediate states of his repository is also possible.

但是,这是一个理论上的想法..人们必须看一下它在实践中的表现.

Yet, it's an theoretical idea .. one has to see how it performs in practice.

替代方法::如果您经常有外部承包商不应该看到您的代码的某些部分,那么我将引用@Anton的注释来设置与权限相关的多个存储库.

Alternative: In case you frequently have external contractors who shouldn't see some parts of your code, I would second @Anton's comment to setup permission related multiple repositories.

这篇关于清理外部承包商的汞库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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