Re: How to delete files and directories from git commit history?
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Jun 12, 2018, 20:26 UTC
- Message-ID
- <CAP8UFD38pLbAZce0bS=G62SCeTKvjn2Eao26Dkm5p72CAx3pYw@mail.gmail.com>
- In-Reply-To
- <20180612154413.3df64441@mydesk.domain.cxm>
Hi,
On Tue, Jun 12, 2018 at 9:44 PM, Steve Litt <slitt@troubleshooters.com> wrote:
Show 7 quoted lines
> My project (call it myproject) had a directory (call it docs/propdir) > that was unnecessary for the project, and I've decided I don't want to > offer the files in that directory as free software. So I need to delete > docs/propdir from all commits in the repository. I did the following, > while in my working repository's myproject directory: > > git filter-branch --tree-filter 'rm -rf docs/propdir' HEAD
[...]
> What command do I do to remove all mention of doc/propdir and its > files from my git history?
Did you check the "CHECKLIST FOR SHRINKING A REPOSITORY" section of the filter-branch man/help page?
Best, Christian.