Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

How to remove a file from commit

# if you want to just remove from latest commit
git rm -r --cached <file/dir>
  
# if you want to remove from all commit history
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch <file/dir>' HEAD
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #remove #file #commit
ADD COMMENT
Topic
Name
4+8 =