GitHub Cloner is a Ruby script to automate cloning all repositories from your GitHub account. It supports both public and private repositories, with a configurable clone path.
- Fetches all repositories (public and private) from your GitHub account.
- Clones repositories into a specified directory.
- Uses
.envfile for storing sensitive information like GitHub tokens.
- Ruby (>= 2.5)
- Git
dotenvgem for managing environment variables
-
Clone this repository:
git clone https://github.com/BaseMax/github-cloner.git cd github-cloner -
Install the required gem:
gem install dotenv
-
Copy the
.env.examplefile to.env:cp .env.example .env
-
Edit the
.envfile to include your GitHub personal access token and desired clone path:GITHUB_TOKEN=your-personal-access-token CLONE_PATH=./../Replace your-personal-access-token with your GitHub token.
Set
CLONE_PATHto your desired directory for cloning (default is./).Note: To generate a personal access token, visit GitHub Token Settings.
ruby github_cloner.rbThe script will:
- Fetch all your repositories from GitHub.
- Clone them into the directory specified by
CLONE_PATH.
Fetching repositories...
Cloning repo1 into ./../...
Cloning repo2 into ./../...
All repositories cloned successfully!
This project is licensed under the MIT License.
Copyright 2025, Max Base