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 --excluded 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.
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 -- --allYou can use this command to query the number of commits before and after as a quick test:
git log --pretty=format:'' | wc -l