diff --git a/README.md b/README.md index 2291f19..7e06a86 100755 --- a/README.md +++ b/README.md @@ -29,6 +29,8 @@ A collection of simple Bash scripts. 1. [Archive-and-encrypt.sh](scripts/archive-and-encrypt.sh): archive a path into a file and encrypt the file 1. [weather.sh](scripts/weather.sh): check the weather in a specified location or using the geolocation of the ip address by default. 1. [WhereIP.sh](scripts/whereIP.sh): Get location of an IP address. +1. [remove-history.sh](scripts/remove-history.sh): Remove ALL history from a Git repository. + ## System Administration 1. [DirectorySize.sh](scripts/directorysize.sh): output a specified directory's size diff --git a/scripts/remove-history.sh b/scripts/remove-history.sh new file mode 100644 index 0000000..6e25558 --- /dev/null +++ b/scripts/remove-history.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +echo Enter Git URL: +read varname +git clone $varname to_remove +cd to_remove +git checkout --orphan latest_branch +git add -A +git commit -am "Deleted Git History" +git branch -D master +git branch -m master +git push -f origin master +cd +rm -rf remove to_remove