X-Git-Url: https://mattmccutchen.net/utils/utils.git/blobdiff_plain/40ea9b7868f2b7746e7cbabfba6aba982096392a..273c390351c42303171c25215304d1cfd6ca02d4:/ungitar diff --git a/ungitar b/ungitar new file mode 100755 index 0000000..8a6d468 --- /dev/null +++ b/ungitar @@ -0,0 +1,19 @@ +#!/bin/bash +# usage: ungitar foo-dir &2" ERR +if ! [ -e "$1" ]; then + mkdir "$1" +fi +cd "$1" + +if [ -e '.git' ]; then + echo 'The destination directory is already a git repository!' 1>&2 + exit 1 +fi +trap "rm -rf .git" EXIT + +ftx .git +git-read-tree master +git-checkout-index --all --force