aboutsummaryrefslogtreecommitdiff
path: root/content/en/blog/commands/git-rewrite-commit-history.md
blob: 6d241eda0c46fa6723cb70b52ba2e03d28ff0f76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
---
title: "Rewrite a git commit history"
linkTitle: "Rewrite a git commit history"
date: 2018-03-05
description: >
  Rewrite a git commit history
---

Here is how to rewrite a git commit history, for example to remove a file :
{{< highlight sh >}}
git filter-branch –index-filter "git rm --cached --ignore-unmatch ${file}" --prune-empty --tag-name-filter cat - -all
{{< /highlight >}}