【问题标题】:git filter-repo: can it be used on a specific branch?git filter-repo:可以在特定分支上使用吗?
【发布时间】:2020-04-06 11:50:35
【问题描述】:

我正在阅读 git filter-repo 可以做什么,因为我想用它做一个小实验......我有这个 repo,我只想从中获取一个目录的历史记录,比如说......主人.....但我不想在主人身上工作。我想创建一个新分支,比如filter-repo-test,让git filter-repo 单独在这个分支上运行它的魔力。我正在阅读手册,但没有看到仅指定给定分支的选项。有可能吗?

https://htmlpreview.github.io/?https://github.com/newren/git-filter-repo/blob/docs/html/git-filter-repo.html

【问题讨论】:

    标签: git git-filter-repo


    【解决方案1】:

    'Miscellaneous Options' 包括 --refs

    --refs

    将历史重写限制为指定的参考。暗示--partial.
    除了--partial 的正常警告(混合新旧历史,refs/remotes/origin/* 不会自动重新映射到refs/heads/* 等),这也可能导致在指定负修订时修剪退化的空合并提交的问题.

    而且...它会移动标签,正如我在“Git Subdirectory Filter with tags”中记录的那样,它确实使用--refs 作为示例。

    【讨论】:

      【解决方案2】:

      没关系,我刚刚找到了。它就在我的鼻子底下。它是用--refs定义的

      【讨论】:

        猜你喜欢
        • 2020-09-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-11-19
        • 2014-03-17
        • 2021-03-15
        • 2013-11-18
        相关资源
        最近更新 更多