Skip to content

Instantly share code, notes, and snippets.

@kodie
Created June 2, 2022 17:58
Show Gist options
  • Save kodie/00e87acf9f1f5b10d308c4e5226e4ddc to your computer and use it in GitHub Desktop.
Save kodie/00e87acf9f1f5b10d308c4e5226e4ddc to your computer and use it in GitHub Desktop.
A bash function to lowercase file and directory names in a git repository
function git-lowercase-file {
tmp="tmp-$RANDOM-$1"
new=$(echo "$1" | tr '[:upper:]' '[:lower:]')
git mv -f $1 $tmp
git mv -f $tmp $new
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment