Skip to content

Instantly share code, notes, and snippets.

@kodie
Created June 2, 2022 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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