git - Removing .gitignore files from previous commits in GitHub -
i added file .gitignore, repository contains previous commits include file. commits here on out no longer track ignored file using
git rm --cached config/secrets.yml
is there quick git command go through of previous commits , remove file showing in commit history?
it’s not easy. have go through each commit , remove file. , keep in mind modify history, careful if collaborating others.
here guide github on how remove sensitive data: https://help.github.com/articles/remove-sensitive-data/
the resulting command should be:
git filter-branch --force --index-filter \ 'git rm --cached --ignore-unmatch config/secrets.yml' \ --prune-empty --tag-name-filter cat -- --all
Comments
Post a Comment