I decided to restructure the folder I keep code in (
~/code, natch) - taking my cue from how Go does it - so that the folder structure represents where code has come from.
As with all things, moving a couple of hundred folders by hand seemed far too daunting so I wrote a bash script to do it.
This script enters each subdirectory within the current directory and, if it has a git remote, moves it to a folder that represents the git remote’s path.
For example, if I had a folder called
scripts that had a git remote of
firstname.lastname@example.org/stilvoid/utils.git, this script will move the folder to
Yes it’s horrid but it did today’s job ;)