How to split repository in Git
Splitting a monorepo into separate repositories is a common scaling decision when a codebase grows and different teams need independent release cycles.
As the creator of CoreUI with 25 years of open-source development experience, I split the CoreUI monorepo into framework-specific packages and preserved the commit history for each component, which was essential for tracking bug history and attribution.
The tool for this is git filter-repo, which can extract a subdirectory into a new repository with its full commit history.
The result is a standalone repository containing only the commits that touched the extracted directory.
How to anonymize commits in Git
Anonymizing Git commits is useful when open-sourcing an internal project, when contributors want to remove personal information, or when team members need to be credited under pseudonyms.
As the creator of CoreUI with 25 years of open-source development experience, I’ve helped contributors anonymize their history before submitting patches to public repositories.
The most flexible approach is git filter-repo with an email or commit callback that replaces names and emails according to a mapping.
This rewrites all matching commits permanently and requires force-pushing to update the remote.
How to remove sensitive data from Git history
Accidentally committing API keys, passwords, or private certificates to a Git repository is a common security incident, and simply deleting the file in a new commit does not remove the credentials from history — they remain visible in every previous commit.
As the creator of CoreUI with 25 years of open-source development experience, I’ve dealt with this exact scenario in public repositories and the fix requires rewriting the entire repository history.
The fastest modern tool is git filter-repo, which rewrites all commits to remove the sensitive file in seconds.
Immediately rotate any exposed credentials after cleaning history — assume they have been compromised from the moment they were pushed.
How to rewrite Git history with git filter-repo
git filter-repo is the modern replacement for git filter-branch, rewriting repository history up to 50 times faster while providing a cleaner, safer interface with better defaults.
As the creator of CoreUI with 25 years of open-source development experience, I switched all projects to git filter-repo the moment it became the officially recommended tool in Git documentation.
It is not bundled with Git — install it separately — but its performance and safety features make it the clear choice for any history rewriting task.
Always work on a fresh clone before running it, as the operation cannot be undone once complete.
How to remove a file from Git history
Removing sensitive files like passwords or API keys from Git history is critical for security when they’re accidentally committed.
As the creator of CoreUI with over 25 years of development experience, I’ve helped teams clean repositories after accidental credential commits many times.
The most effective modern solution is to use git filter-repo, which is faster and safer than the older filter-branch command.
This tool completely rewrites history to remove all traces of the file.