Skip to content

Latest commit

 

History

History
10 lines (7 loc) · 331 Bytes

20220608_permantly-delete-files-on-git.md

File metadata and controls

10 lines (7 loc) · 331 Bytes

Permantly delete files on git

Purpose: remove sensitive or secret-contained files

Steps:

  1. Remove file
  2. Add the file to .gitingore
  3. Permantly remove a file from Git history: git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch <file-name>" HEAD
  4. Force push to re-write history git push --force.