Hi, I had this problem today - I had an old repository from when I was just starting to work with Git, and I needed to hide the change history because there was information in a certain commit that I didn't want to disclose.
But I have a lot of commits there, and I don't want to lose my beloved commit statistics, so how do I solve this? 🤔
To do this, we need to edit all commits in the repository and hide the changes and change commit names to [REDACTED]
Here is the script for that 👇
# Save the current commit hash to a variable so we can go back to it later