For github itself the answer is "contact them if you think you pushed a secret".
For git. You can run `git maintenance run` or the legacy command `git gc`.