This Python script automates the process of cloning all repositories starred by a GitHub user. Simply provide your GitHub username and Personal Access Token (PAT), and it will fetch and clone the repositories into a local directory.
- Automatically fetches starred repositories.
- Clones each repository locally.
- Skips already cloned repositories to avoid duplication.
- Python 3.x
requests
library (pip install requests
)GitPython
library (pip install gitpython
)- A GitHub Personal Access Token (PAT)
git clone https://github.com/manupawickramasinghe/clone-github-starred.git
cd clone-github-starred
pip install -r requirements.txt
Edit github-clone.py
and set your GitHub username and PAT:
username = 'Enter Your Username'
token = 'Enter Your PAT'
Execute the script to clone starred repositories:
python github-clone.py
- Ensure your PAT has the necessary permissions to read repository data.
- Verify your network connection if cloning fails.
- If repositories already exist, the script will skip them.
Feel free to submit issues or pull requests to enhance the functionality.
This project is licensed under the MIT License.