Skip to content

Instantly share code, notes, and snippets.

@giljulio
Created April 5, 2017 11:20
Show Gist options
  • Save giljulio/1f0e6e3e3b0b3f233ad7734502c1004a to your computer and use it in GitHub Desktop.
Save giljulio/1f0e6e3e3b0b3f233ad7734502c1004a to your computer and use it in GitHub Desktop.
Git move directory
#!/bin/sh
from="$1"
to="$2"
echo "Git moving files from $from to $to"
mkdir $to
for entry in "$search_dir"./"$from"/*
do
echo "Moving file $from/${entry##*/} to $to/${entry##*/}"
git mv $from/${entry##*/} $to/${entry##*/}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment