Name: Ismaël Maurice
Github: https://github.com/tisma95
Email: ismael.tuo@edigrp.com
This repository goal is to clone all repositories of github associate to the user:
- the personal user repositories private and public,
- the user organization repositories,
- the ancestor repositories,
- the fork repositories.
If the repository existed pull to update will be.
Clone all branchs in folder.
WARNING: The repository name with space will be replace in clone folder by -. Example the repository name like repo 1 will be clone with name repo-1.
Before starting the project you need to install on your computer the following packages:
Run the commands inside the folder:
- If no env folder exists init the environment else skip this step
python -m venv env
or
python3 -m venv env
or for ubuntu
virtualenv venv
If any problem follow this page to fix and intall virutalenv: https://gist.github.com/frfahim/73c0fad6350332cef7a653bcd762f08d
- If the env folder already exists, run the following command to activate it
source env/bin/activate
or for windows
env\Scripts\activate.bat
3 Run the installation of package via following command
pip install -r requirements.txt
-
Init the environment variable by following Environment variables
-
Create the token on your Github access only read access is required choose between:
- Token via Fine-grained personal access tokens with following authorization:
- Token via Personal access token (classic) with following authorization (only repo):
Warning If you have the fork repository, should give the workflow authorization to permits to synchronize the fork repository before clone it. Like following image:
- Token via Fine-grained personal access tokens with following authorization:
-
Run the script with command
python main.py
orpython3 main.py
Create the file .env inside folder with following example variable
# Clone repo host
DOMAIN = github.com
# Domain protocol type http or https
PROTOCOL = https
# Access Token To Domain
TOKEN = your_generate_token_here
# Storage Folder => Folder where the repositories will be save => example /home/toto or C:\users\toto for windows
FOLDER = folder_path_here
-
If new package is install we can update the requirements.txt with command
pip freeze > requirements.txt
orpython3 -m pip freeze > requirements.txt
-
Exit the env via:
deactivate
or for windowsenv\Scripts\activate.bat