Clone all repos in a GitHub organization organization
Ever moved to a new company and had to clone a bunch of new repos from the private organization? This one hopefully solves it.
go build .
./github-clone --token "some-token" --org "some-organization" --desination "some-folder"
If you use multiple GitHub accounts and therefore SSH keys, you SSH config, e.g. like this:
Host github.com
HostName github.com
User some-user
IdentityFile ~/.ssh/some-key
Host github-company
HostName github.com
User some-other-user
IdentityFile ~/.ssh/some-other-key
In this case you can specifiy the --host
option to make sure the git clone
matches your SSH config.
Hence, calling ./github-clone --token "some-token" --org "some-organization" --desination "some-folder" --host "github-company"
with result in a URL used for cloning like this: git@github-company:some-organization/some-repo.git
.
- Fork it (https://github.com/splieth/github-clone/fork).
- Create your feature branch (git checkout -b feature/some-feature).
- Commit your changes (git commit -am 'Add some some-feature').
- Push to the branch (git push origin feature/some-feature).
- Create a new PR.
- Profit.