Skip to content
Some scripts I wrote to save and restore my development directory on a new machine
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Save and Restore Your Development Directory

If you're like me, you have many projects under a directory called development/. You may even have some nested directories for related projects. As an example, here's a fraction of my development directory:


Each of those projects is something that is checked out from GitHub.

While I do back up my machine with Time Machine, I wanted additional options, especially in the scenario where I'm not restoring a machine, but instead moving to a new machine.

So I wrote these scripts. They're relatively straightforward.

Saving Your Development Directory

Run the script as follows:

bash <(curl -s path/to/development/directory repos.txt

This will go through your development directory, find every Git repo, and write the directory path (relative to the path given above) and the origin Git resource it uses.

Restoring Your Development Directory

Run the script as follows:

bash <(curl -s repos.txt path/to/new/directory

That will go through the file with directories and repos, and clone each of them the target directory, mirroring the directory structure of the old development directory.


Q: What if there are multiple remotes on a repo?

A: These scripts do not address this.

Q: What if a clone in fails because I didn't have ssh-agent set up, etc.?

A: Then the script will stop.

Q: What if a repo's directory exists due to a previously aborted run of

A: If a repo's directory exists, it will be sanity checked to make sure the repo is sane, and then skipped.


  • @dmuth on Twitter
  • Douglas Muth on Facebook
  • Email: doug.muth AT gmail DOT com
  • ...or just file an issue on this project!

You can also read about these scripts on my blog...

You can’t perform that action at this time.