Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add warning message to git-remove-history.sh

  • Loading branch information...
commit 389817e529d80f2e375c8bec57eb2f9fa939abba 1 parent 852232d
@rkuhn rkuhn authored
Showing with 13 additions and 2 deletions.
  1. +13 −2 scripts/git-remove-history.sh
View
15 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
+rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune
Please sign in to comment.
Something went wrong with that request. Please try again.