git filter-repo:可以在特定分支上使用吗? [英] git filter-repo: can it be used on a specific branch?

查看:195
本文介绍了git filter-repo:可以在特定分支上使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读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?

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

推荐答案

--refs

-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 of refs/remotes/origin/* to refs/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屋!

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