https://github.com/beangreen247/clone-all-github-repos-script
A script for cloning multiple/all repos from a user on github
https://github.com/beangreen247/clone-all-github-repos-script
bash beangreen247 clone git github repo script ssh-agent ssh-key
Last synced: 6 months ago
JSON representation
A script for cloning multiple/all repos from a user on github
- Host: GitHub
- URL: https://github.com/beangreen247/clone-all-github-repos-script
- Owner: BeanGreen247
- Created: 2019-09-09T19:12:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-27T21:33:41.000Z (about 6 years ago)
- Last Synced: 2025-08-15T03:59:28.542Z (6 months ago)
- Topics: bash, beangreen247, clone, git, github, repo, script, ssh-agent, ssh-key
- Language: Shell
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Clone all Github repos script
**NOTE: If you want to clone somebody else's repos they have to give you their RSA key.**
Install these packages
```
sudo apt install git curl xclip -y
```
Setup git for your account
```
git config user.name "username"
git config user.password "password"
```
Next generate ssh key
```
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
```
Start the ssh-agent in the backgound
```
eval "$(ssh-agent -s)"
> Agent pid 59566
```
Add the generated ssh key to the ssh-agent
```
ssh-add ~/.ssh/id_rsa
```
Copy the generated ssh key to your clipboard using xclip
```
xclip -sel clip < ~/.ssh/id_rsa.pub
```
In the upper-right corner of any page, click your profile photo, then click Settings.
In the user settings sidebar, click SSH and GPG keys.
Click New SSH key or Add SSH key.
In the "Title" field, add "BeanGreen247's Github repo clone script"
Paste your key into the "Key" field.
Click Add SSH key.
If prompted, confirm your GitHub password.
Make script executable
```
chmod +x Github-Clone-All-Repo-Script.sh
```
## Script usage
The syntax
```
sh ./Github-Clone-All-Repo-Script.sh
```
Example
```
sh ./Github-Clone-All-Repo-Script.sh BeanGreen247 1
```
This example will clone just 1 of my repos in alphabetical order.
This script makes a folder in the home directory called Github-$USER where $USER is the username.
That's it, enjoy cloning.