Completely purges a file from history.
git rm --cached --ignore-unmatch <path>
to delete the file in the specified <path>
.git filter-branch --force --index-filter <command> --prune-empty --tag-name-filter cat -- --all
to rewrite the branch's history, passing it the previous command.git push <remote> --force -all
to force push the changes to the remote repository.git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch <path>" \
--prune-empty --tag-name-filter cat -- --all
git push <remote> --force --all
git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch config/apiKeys.json" \
--prune-empty --tag-name-filter cat -- --all
# Purges `config/apiKeys.json` from history
git push origin --force --all
# Force pushes the changes to the remote repository
Git, Repository
Prints a list of lost files and commits.
Git, Repository
View git's reference logs. This is especially useful for finding references that don't show up in commit history.
Git, Repository
Deletes a remote branch.