diff --git a/scripts/git-remove-history.sh b/scripts/git-remove-history.sh index 9db67d2490..5daf35f5c5 100755 --- a/scripts/git-remove-history.sh +++ b/scripts/git-remove-history.sh @@ -1,4 +1,15 @@ #!/bin/bash + +cat <<'EOT' +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@ This command rewrites GIT history like git-rebase. Beware never to rewrite @ +@ trees which are already published, as that would deeply upset all cloning @ +@ repos. For more details see 'git help rebase'. Tread carefully! @ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +EOT +read -p "I know what I am doing: " answer +test "$answer" = yes || exit 1 + set -o errexit # Author: David Underhill @@ -7,7 +18,7 @@ set -o errexit # you want to delete, e.g., git-delete-history path1 path2 if [ $# -eq 0 ]; then - exit 0are still + exit 0 fi # make sure we're at the root of git repo @@ -21,4 +32,4 @@ files=$@ git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch $files" HEAD # remove the temporary history git-filter-branch otherwise leaves behind for a long time -rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune \ No newline at end of file +rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune