How to optimize Git performance
Git performance degrades over time in large repositories with thousands of commits, large files, and many contributors — slow git status, git fetch, and git log operations indicate the repository needs maintenance.
As the creator of CoreUI with 25 years of open-source development experience, I regularly optimize the CoreUI repository and contributor workflows to keep Git operations fast as the codebase grows.
The primary tools are git maintenance for automated upkeep, git gc for manual cleanup, and repository configuration settings that enable performance optimizations.
Most optimizations are one-time setup or periodic maintenance commands that dramatically improve day-to-day performance.
How to manage multiple remotes in Git
Managing multiple Git remotes lets you push code to different destinations simultaneously — maintaining mirrors on GitHub and GitLab, working with both origin and upstream in open-source projects, and deploying to different environments from the same repository.
As the creator of CoreUI with 25 years of open-source development experience, I maintain multiple remotes in every major project: the canonical repository, contributor forks, and deployment targets.
The commands are simple — git remote add, git remote set-url, and git push --all — but understanding when to use each pattern makes a significant difference in team workflows.
You can have as many remotes as needed; there is no Git limit.
How to manage monorepo with Git
Managing a monorepo in Git requires strategies that keep clone times fast, working directories focused, and commits attributable to specific packages — problems that become severe as the repository grows. As the creator of CoreUI with 25 years of open-source development experience, I manage a monorepo with multiple framework packages and rely on sparse checkout, shallow clones, and conventional commits to keep the workflow efficient. The key techniques are: sparse checkout to only fetch files you need, partial clone to avoid downloading all objects, and conventional commit prefixes to identify which package each commit affects. Git’s built-in tools handle all of this — no third-party tooling required for the Git layer itself.
How to combine repositories in Git
Combining multiple Git repositories into one — often called a monorepo migration — requires merging their histories while preserving every commit, author, and date from each source repository.
As the creator of CoreUI with 25 years of open-source development experience, I’ve combined separate framework-specific packages into unified repositories and the process requires care to avoid history loss or path conflicts.
The standard approach is to add each source repository as a remote, fetch its history, move its files into a subdirectory, and merge the histories with --allow-unrelated-histories.
Each source repository ends up in its own subdirectory so their files don’t collide.
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 rewrite Git history with filter-branch
git filter-branch rewrites every commit in your repository’s history according to filters you define, which is necessary when you need to remove a large file, scrub sensitive data, or correct commit author information across all commits.
As the creator of CoreUI with 25 years of open-source development experience, I’ve used this tool to purge accidentally committed credentials and remove build artifacts that bloated repository size.
Note that git filter-branch is the legacy approach — git filter-repo is faster and safer for most use cases — but understanding filter-branch is still valuable for environments where installing additional tools is restricted.
Both tools permanently rewrite history and require all collaborators to re-clone or re-base after the operation.
How to clean Git history
A clean Git history makes it easier to understand what changed and why, to git bisect for regressions, and to review pull requests.
As the creator of CoreUI with 25 years of open-source development experience, I review history quality as part of every pull request and use interactive rebase to clean branches before merging.
The primary tool is git rebase -i (interactive rebase), which lets you squash, reword, drop, and reorder commits with a text editor.
The result is a polished history that reads as a coherent narrative rather than a stream of “WIP” and “fix typo” commits.