git filter-repo:可以在特定分支上使用吗? [英] git filter-repo: can it be used on a specific branch?
问题描述
我正在阅读git filter-repo
可以做什么,因为我想对此做一个小实验....我有这个仓库,我只想从中获取一个目录的历史记录,例如....大师.....但我不想从事大师工作.我想创建一个新分支,例如filter-repo-test
,然后让git filter-repo
仅在该分支上运行其魔术.我正在阅读手册,但没有看到仅指定给定分支的选项.有可能吗?
I'm reading about what git filter-repo
can do because I want to do a small experiment with it.... I have this repo where I only want to get the history of one directory from, say.... master..... but I don't want to work on master. I would like to create a new branch, say filter-repo-test
and let git filter-repo
run its magic on this branch alone. I'm reading the manual but I don't see an option to specify only a given branch. Is it possible?
推荐答案
-refs< refs +>
--refs <refs+>
将限制历史记录重写为指定的引用.表示
--partial
.
除了--partial
的常规警告(混合了新旧历史记录,没有将refs/remotes/origin/*
自动重新映射到refs/heads/*
等)之外,当指定了负面修订时,这也可能导致修剪简并的空合并提交的问题.
Limit history rewriting to the specified refs. Implies
--partial
.
In addition to the normal caveats of--partial
(mixing old and new history, no automatic remapping ofrefs/remotes/origin/*
torefs/heads/*
, etc.), this also may cause problems for pruning of degenerate empty merge commits when negative revisions are specified.
然后...它会移动标签,如我在"带有标签的Git子目录过滤器"中所述,确实以--refs
为例.
And... it will move tags, as I documented in "Git Subdirectory Filter with tags", which does uses --refs
, as an example.
这篇关于git filter-repo:可以在特定分支上使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!