Skip to content

Instantly share code, notes, and snippets.

@jyntran
Created June 28, 2018 02:07
Show Gist options
  • Save jyntran/57f52e2a23cafff5bf65a44a1b92187d to your computer and use it in GitHub Desktop.
Save jyntran/57f52e2a23cafff5bf65a44a1b92187d to your computer and use it in GitHub Desktop.
sensitive data
git filter-branch --force --index-filter \
'git rm -r --cached --ignore-unmatch PATH-TO-SENSITIVE-FILE' \
--prune-empty --tag-name-filter cat -- --all
# the third portion may not be neccessary
echo PATH-TO-SENSITIVE-FILE >> .gitignore
git add .gitignore && git commit -m "update gitignore"
git push -f origin BRANCH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment