Answers for "git remove from history"

1

git remove file from history

$ git rm --cached giant_file
# Stage our giant file for removal, but leave it on disk
Posted by: Guest on April-09-2020
2

remove file history from git

git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch path_to_file" HEAD
Posted by: Guest on May-22-2020
0

git remove from history

$ git rm --cached giant_file
# Stage our giant file for removal, but leave it on disk
$ git commit --amend -CHEAD
# Amend the previous commit with your change
# Simply making a new commit won't work, as you need
# to remove the file from the unpushed history as well
Posted by: Guest on July-29-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language