add warning message to git-remove-history.sh
This commit is contained in:
parent
852232db9d
commit
389817e529
1 changed files with 13 additions and 2 deletions
|
|
@ -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
|
||||
rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue