Skip to content

Instantly share code, notes, and snippets.

@pravynandas
pravynandas / github_remove_secret_files_history.sh
Last active November 28, 2023 15:00
Delete files with secrets in git history - github
#!/bin/bash
while read -r line; do
if [[ $line == *"blob id:"* ]]; then
# echo "$line"
arrIN=(${line//:/ })
blobId=${arrIN[4]}
echo "blob id:$blobId"
pathx=$(git rev-list --all --objects | grep $blobId)
# echo "$pathx"