svn2git with --exclude,有什么方法可以忽略空/空白提交吗?
我正在将一个大型 SVN 存储库转换为多个 git 存储库(每个项目一个)。
我正在为每个存储库运行 svn2git ,其中包含所有不需要的目录--exclude
d,这可以很好地保留标签和分支(我在转换后删除所有不相关的标签和分支)
唯一的问题是我有大量空提交(与排除的目录相关的提交)。
有没有办法在 svn2git 过程中排除这些空提交?
这个解决方案是一个很好的方法事后删除它们,但 filter-branch
仅影响当前分支,而不影响所有其他分支和标签。
I'm converting a big SVN repository into multiple git repositories (one for each project).
I am running svn2git for each repo with all unwanted directories --exclude
d this works well to keep the tags and branches (I delete all the unrelated tags & branches after the conversion)
The only problem is I have loads of empty commits (commits relating to the excluded directories).
Is there any way to exclude these empty commits during the svn2git process?
This solution is a fine way to remove them after the fact, but filter-branch
only affects the current branch, and not all the other branches and tags.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决了。
据我所知,此命令将重写历史记录,删除空白提交,但保留其他所有内容。
git filter-branch --tag-name-filter cat --prune-empty -- --all
您可以使用此命令查询前后的提交次数作为快速测试:
git log --pretty=格式:'' | wc -l </code>
Worked it out.
To the best of my knowledge, this command will rewrite the history, removing the blank commits, but preserving everything else.
git filter-branch --tag-name-filter cat --prune-empty -- --all
You can use this command to query the number of commits before and after as a quick test:
git log --pretty=format:'' | wc -l