Skip to content

This repository goal is to clone/pull all repositories of github associate to the user to specific location.

License

Notifications You must be signed in to change notification settings

tisma95/github-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Github Repository Clone

Author

Name: Ismaël Maurice

Github: https://github.com/tisma95

Email: [email protected]

Description

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.

Requirement

Before starting the project you need to install on your computer the following packages:

Python >=3.9

Git

Started

Run the commands inside the folder:

  1. 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
  1. 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
  1. Init the environment variable by following Environment variables

  2. Create the token on your Github access only read access is required choose between:

    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:

  3. Run the script with command python main.py or python3 main.py

Environment variables

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

Other informations

  • If new package is install we can update the requirements.txt with command pip freeze > requirements.txt or python3 -m pip freeze > requirements.txt

  • Exit the env via: deactivate or for windows env\Scripts\activate.bat

Useful packages

Requests Documentation

Github REST API Documentation

python-dotenv Documentation

About

This repository goal is to clone/pull all repositories of github associate to the user to specific location.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages