如何从github/gitlab中的所有分支中删除特定对象
假设我有100个分支,每个分支都有file1,file2 ..... file10。现在,我想从所有100个分支中删除File2。我该怎么办将其从所有分支中删除?
Lets assume that I have 100 branches and each branches have file1,file2.....file10. Now I want to delete file2 from all of 100 branches. What should I do to delete that from all branches?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
git filter-repo
(基于Python ,be 首先安装了)
git filter-branch-branch
或bfg 在git 2.22或更多之后被淘汰)=“ https://htmlpreview.github.io/?https://github.com/newren/newren/git-filter-repo/blob/blob/blob/docs/html/git-filter-repo.htmlleter-repo.htmlllllllltmllltmllltering_filtering_filtering_filter_on_on_on_on_on_pathssssse_eleso_also_also see_aleorlobly = “>基于路径的过滤:
它的男人页面提到,关于
git filter-branch
:git filter-repo
will 迫使您先进行备份,然后继续更改您要过滤的本地存储库的历史。检查是否已经清理了所有分支,在所有分支中寻找
file2
。You can use
git filter-repo
(python-based, to be installed first) for that (sincegit filter-branch
or BFG are obsolete after Git 2.22 or more)Use a path-based filtering:
Its man page mentions, about
git filter-branch
:git filter-repo
will force you to make a backup first, then proceed to change the history of the local repository you are filtering.Check that all branches have been cleaned up, by looking for
file2
in all branches.