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?
In case anyone looks for a Windows solution, here's a little function in PowerShell to do the trick (could be oneliner/alias if not the fact I need it to work both with and without proxy).
This python one-liner will do what you need. It:
for each, makes a system call to
git clone
Another shell script with comments that clones all repositories (public and private) from a user:
I made a script with Python3 and Github APIv3
https://github.com/muhasturk/gitim
Just run
There is also a very useful npm module to do this. It can not only clone, but pull as well (to update data you already have).
You just create config like this:
and do
gitall clone
for example. Orgitall pull
Simple solution: