Our source has been through SVN, then Mercurial, and now git. When we converted from Mercurial to Git in Kiln, we didn't have any issues. However now that we are moving over to github we are getting these errors:
remote: error: object f2371b54e17a355e23e06649d17b19e7e96130ab:contains '.git'
This is because in our history we did have some git projects in our source tree. So now I'm trying to prune those out with:
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch .git' --prune-empty --tag-name-filter cat -- --all
I've read several questions/FAQ on this, but I wonder if because we're trying to get a git folder removed if that's the problem. I'd love to get some feedback.
No, removing those folders (with BFG as you saw) is the solution, not the problem.
Trying to push a repo with .git inside to a GitHub repo is likely to trigger that error message, because it means you are pushing nested repos which have been incorrectly versioned in the parent repo.