Skip to content

Instantly share code, notes, and snippets.

@azalea
Created March 6, 2014 16:31
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 azalea/9393605 to your computer and use it in GitHub Desktop.
Save azalea/9393605 to your computer and use it in GitHub Desktop.
Replace file extensions in git repository
#!/bin/sh
oldext=".md"
newext=".markdown"
for file in $(git ls-files | grep ${oldext}\$); do
echo processing $file...
filename="${file%.*}"
git mv $file ${filename}$newext
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment