#!/usr/bin/bash function help() { cat </dev/null if [[ $? == 0 ]]; then echo "Removed stored data for commit $head_sha." fi local repo_root="$(git_repo_toplevel)" git reset HEAD "$repo_root" >/dev/null git clean -f -d -q -- "$repo_root" >/dev/null git checkout -- "$repo_root" >/dev/null echo "Unstaged changes and untracked files removed." } # Remove (permanently) all saved tags function clean_all_tags() { git for-each-ref refs/tags --format='%(refname:short)' | \ while read tag; do if [[ "$tag" =~ ^git-jump- ]]; then git tag -d "$tag" fi done } # Handle CLI arguments if [[ "$1" == "clean" ]]; then clean elif [[ "$1" == "cleanall" ]]; then clean_all_tags clean else usage exit 1 fi