Git remove file from history

In this article let’s discuss about Git remove file from history. Let’s go through the following methods without any delay.

Method 1:

$ git rm --cached giant_file
// Stage our giant file for removal, but leave it on disk

If you are facing any issues with the above approach then try the alternative that is given below. It may look similar by have a try!

Method 2 :

git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch path_to_file" HEAD

Hope the above solution works.

Realted Posts : How to open postgresql in mac