【问题标题】:Changing permissions with deep Git repository-repository -tree with sub-repos and submodules?使用带有子存储库和子模块的深层 Git 存储库-存储库-tree 更改权限?
【发布时间】:2012-05-28 21:33:49
【问题描述】:

我决定在 repository -tree 中默认限制可见性范围,以便为优化的东西创建 public 文件夹。现在因为有很多子存储库,我得到了一个痛苦的提交或一些聪明的想法。我不确定最好的方法——我想过用 find 遍历 repos,然后对每个 repo 做一个一致的 -dummy 提交,比如"default perms lower and polished public things to public dir in the root to get the quality up",但我可能正在重新发明轮子。我不能选择限制子存储库和子模块的数量,因此提交必须从最低的 repo 开始,然后如果使用 find 则一点一点地遍历。

如何处理这种深度的 Git repo-repo -tree 更新?

可能相关

  1. Git: how to avoid repetitive committing with sub-sub-sub... Git -repos?

  2. Git: a tool to manage and to structure Projects?

【问题讨论】:

    标签: git


    【解决方案1】:

    使用更好的工具!

    避免像$ find . -exec git checkout '{}' \; 这样的黑客攻击,然后递归/手动修复权限。有一个名为 Gitslave 的工具可以更轻松地管理不断扩大的投资组合。有价值的文章here。我还建议您阅读此线程 here,再次出现 SethRobertson 的文章——非常好阅读。

    为什么需要 Gitslave?

    假设您对 repo Happy.git 的结构进行了更改,例如 "Works.git > Project.git > Pictures.git > Happy.git"。然后有人 尝试从您的裸 -git 存储库中提取,例如 Project.git。因为 你是一个 git,你只在Happy.git 中提交了事情。现在你的 朋友会得到一些讨厌的错误。一个懒惰的 git 会使用 gitslave -工具。

    $ mkdir t1; cd t1; mkdir t2; cd t2; mkdir t3; git init; echo "t3" >t3; git add .; git commit -m "t3"; cd ..; git init; echo "t2" >t2; git add .; git commit -m "t2"; git init; echo "t1" >t1; git add .; git commit -m "t1"; cd ..; cd t1/t2/t3; echo "only here">only; git add .; git commit -m "only"; cd ../..; git status
    # On branch master
    # Untracked files:
    #   (use "git add <file>..." to include in what will be committed)
    #
    # t2/
    $ Look you need to do repetitive work because you did not use Gitslave!
    

    安装 Gitslave 的演练

    不幸的是,Gitslave 还没有在 Apt-get 所以下载 here。

    它看起来有点像 Maven,更多 here。 你用它来管理你的项目。首先,您指定 super -repo 然后附加从属-repos。

    $ git clone http://someGitRepoHere.com/xyz.git super
    $ cd super; gits prepare
    $ gits attach http://someBareRepo.git yourDirHere
    

    关于 153 等行的更多信息 here.

    当 Gitslave 进入 apt-get 等包管理软件时,我会继续回答这个问题,这样它对人们更有用。

    【讨论】:

    • 请阅读此线程here 中的讨论—— gitslave 可能不是该问题的最佳解决方案,尚不确定。也存在类似 git-subtree 的东西,抱歉,没有经验 - git-subtree 和 gitslave 都还没有基础,所以这个线程和后者应该仔细同行评审,谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-20
    • 2013-04-30
    • 2015-09-25
    • 1970-01-01
    相关资源
    最近更新 更多