gitgithubgit-clone

How to clone all repos at once from GitHub?


I have a company GitHub account and I want to back up all of the repositories within, accounting for anything new that might get created for purposes of automation. I was hoping something like this:

git clone git@github.com:company/*.git 

or similar would work, but it doesn't seem to like the wildcard there.

Is there a way in Git to clone and then pull everything assuming one has the appropriate permissions?


Solution

  • I don't think it's possible to do it that way. Your best bet is to find and loop through a list of an Organization's repositories using the API.

    Try this:

    It's a little bit of extra work, but it's necessary for GitHub to have proper authentication.