concept entire history in category git

appears as: entire history
Git in Practice

This is an excerpt from Manning's book Git in Practice.

Technique 4 briefly discussed that Git is capable of rewriting the history of a repository. Because each repository contains the entire history, this ranges from undoing a single commit to rewriting data on every commit in the repository. I make use of rewriting history regularly to ensure that merged branches have a clean, readable history made up of small commits before merging. You can read more about this in section 13.2 and chapter 14. Before jumping in to rewriting history, let’s start by learning about how to avoid losing committed data using git reflog.

Technique 47 Rewriting the entire history of a branch: git filter-branch

There are times when rewriting a few commits isn’t enough; you want to rewrite the entire history of a branch. Perhaps you accidentally committed confidential files early in the project that you want to remove, or you want to split a large repository into multiple smaller ones.

Git provides a tool called git filter-branch for these cases. It iterates through the entire history of a branch and lets you rewrite every commit as it does so. This can be used to rewrite all the commits in an entire repository.