#!/bin/bash -e if [[ "$1" = "" ]] then echo "Usage: $0 dir" echo "Takes a git working copy and removes all its files" exit 1 fi cd $1 find . -not -path "./.git/*" -not -path "./.git" -delete cd ..