Skip to content

Instantly share code, notes, and snippets.

@rduplain
Created February 1, 2011 17:21
Show Gist options
  • Select an option

  • Save rduplain/806194 to your computer and use it in GitHub Desktop.

Select an option

Save rduplain/806194 to your computer and use it in GitHub Desktop.
Mirror a GitHub project to a local filesystem.
#!/bin/bash
# usage: mirror-github <account_name> <project_name>
git clone --mirror [email protected]:${1}/${2}.git
#!/bin/bash
# Run in a directory with *.git repository directories.
for repo in *.git; do
pushd $repo
git fetch
popd > /dev/null
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment