Next.js starter your AI actually understands. Ship internal tools in days not weeks. Pre-order $199 $499 → [Get it now]

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.

Read More…

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.

Read More…

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.

Read More…

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.

Read More…

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.

Read More…

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.

Read More…

How to squash commits in Git

Squashing commits combines multiple small commits into a single, meaningful commit before merging a feature branch, making the project history clean and easy to navigate. As the creator of CoreUI with 25 years of open-source development experience, I review pull requests daily and always ask contributors to squash work-in-progress commits before merging. The most straightforward method is interactive rebase with git rebase -i, which gives you full control over which commits to squash and what message to use. Clean commit history makes git log, git bisect, and git blame significantly more useful.

Read More…

How to clone with depth in Git

The –depth parameter controls how many commits to download during clone, providing flexible balance between history access and clone performance. As the creator of CoreUI, a widely used open-source UI library, I’ve optimized Git operations for various use cases throughout my 25 years of development experience. The most versatile approach is choosing appropriate depth value based on requirements: depth 1 for CI/CD, deeper values for development with recent history. This method enables customizable clone performance, preserves recent history for debugging, and allows incremental history deepening when needed.

Read More…

How to filter commits by file in Git

Understanding the complete history of a specific file or directory is essential for debugging, code review, and tracking feature development. With over 25 years of software development experience and as the creator of CoreUI, I regularly investigate file histories to understand code evolution. Git log accepts file paths as arguments to filter commits that modified those specific files or directories. This approach reveals who changed a file, when, and why, making file-level archaeology straightforward.

Read More…

How to search authors in Git history

Tracking individual developer contributions, reviewing specific author’s work, or finding who made certain changes requires filtering commits by author. As the creator of CoreUI with over 25 years of software development experience, I regularly search Git history to track contributions across team members. Git log provides the --author flag to filter commits by author name or email using pattern matching. This approach helps identify who worked on specific features, review coding patterns, or analyze contribution frequency.

Read More…
Subscribe to our newsletter
Get early information about new products, product updates and blog posts.
How to loop inside React JSX
How to loop inside React JSX

The Best Bootstrap Alternative for Developers in 2025
The Best Bootstrap Alternative for Developers in 2025

How to Detect a Click Outside of a React Component
How to Detect a Click Outside of a React Component

How to loop through a 2D array in JavaScript
How to loop through a 2D array in JavaScript

Answers by CoreUI Core Team