<commit_before>echo -n "Clean all git commit?(y/n)? "
read answer
if [ "$answer" != "${answer#[Yy]}" ] ;then
    git checkout --orphan latest_branch
    git add -A
    git commit -am "Delete all previous commit"
    git branch -D master
    git branch -m master
fi

## see https://github.com/18F/C2/issues/439

echo -n "Start?(y/n)? "
read answer
if [ "$answer" != "${answer#[Yy]}" ] ;then
    echo "Cleanup refs and logs"
    rm -Rf .git/refs/original
    rm -Rf .git/logs/

    echo "Cleanup unnecessary files"
    git gc --aggressive --prune=now

    echo "Prune all unreachable objects"
    git prune --expire now
fi

#git push -f origin master<commit_msg>git clean<commit_after>echo -n "Clean all git commit?(y/n)? "
read answer
if [ "$answer" != "${answer#[Yy]}" ] ;then
    git checkout --orphan latest_branch
    git add -A
    git commit -am "Delete all previous commit"
    git branch -D master
    git branch -m master
fi

## see https://github.com/18F/C2/issues/439
echo -n "Start?"
select yn in "Yes" "No"; do
    case $yn in
        Yes ) echo "Cleanup refs and logs"
            rm -Rf .git/refs/original
            rm -Rf .git/logs/

            echo "Cleanup unnecessary files"
            git gc --aggressive --prune=now

            echo "Prune all unreachable objects"
            git prune --expire now
            break;;
        No ) exit;;
    esac
done

#git push -f origin master
{'fraction_non_alphanumeric': 0.1251778093883357, 'fraction_numerical': 0.008534850640113799, 'mean_word_length': 2.2569444444444446, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7344395', 'n_tokens_mistral': 478, 'n_tokens_neox': 467, 'n_words': 168}