Skip to content

Instantly share code, notes, and snippets.

@pmachapman
Last active May 11, 2017 02:54
Show Gist options
  • Save pmachapman/5316fcd83251c2693aa7217f820b5f97 to your computer and use it in GitHub Desktop.
Save pmachapman/5316fcd83251c2693aa7217f820b5f97 to your computer and use it in GitHub Desktop.
Converts a series of zip files into git revisions. Can be used as a one line bash command. Change paths to suit....
#!/bin/bash
for f in `ls -X *.zip | sort --version-sort`;\
do rm -rf ~/source/repos/unrar/* ;\
unzip $f -d ~/source/repos/unrar/ ;\
cd ~/source/repos/unrar/ ;\
git add . ;\
git commit -m "Updated to ${f%.zip}" ;\
cd ~/desktop/unrarsrc/ ;\
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment