Skip to content

Instantly share code, notes, and snippets.

@oxr463
Last active May 3, 2021 16:53
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 oxr463/656080bf1a63455b2e644d201224e1cb to your computer and use it in GitHub Desktop.
Save oxr463/656080bf1a63455b2e644d201224e1cb to your computer and use it in GitHub Desktop.
Lowercase all file names in git repository
#!/bin/sh
# Lowercase all file names in git repository
# SPDX-License-Identifier: 0BSD
# FIXME: recurse subdirectories
for file in *; do
lowercase_name=$(echo $file | awk '{ print tolower($0) }')
# https://stackoverflow.com/a/30654833/8507637
git mv "${file}" "_${lowercase_name}"
git mv "_${lowercase_name}" "${lowercase_name}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment