Remove sensitive data from git history


/ Published in: Bash
Save to your folder(s)



Copy this code and paste it in your HTML
  1. git filter-branch --index-filter 'git rm --cached --ignore-unmatch configuration.php' HEAD
  2.  
  3.  
  4. ## skip if already in ignore file
  5. echo 'configuration.php' >> .gitignore
  6. git add .gitignore
  7. git commit -m "modified ignore file"
  8.  
  9. git pull
  10. git push origin master --force

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.