Created by TheMitoSan, this is a tool written in ts that aims to help importing / preserving git repos.
Important
GRPP is a tool that only focus on git repos! If you want to preserve GitHub repos including issues, releases and more - check out jan9103's github-repo-backuper or r-jb's CodeStreisand.
- Requirements
- How to install
- How to build
- How to uninstall
- How to use
- External tools used on this project
- External code snippets used on this project
git,npmandnodepackages.
You can install all required packages by running some of the commands below:
# Arch based distros <3
sudo pacman -S nodejs git npm
# Debian based distros
sudo apt update
sudo apt install nodejs git
# Fedora based distros
sudo dnf update
sudo dnf install nodejs gitImportant
GRPP uses nano as default text editor! If you want to use something else, you can change it by running grpp --setEditor=[YOUR_COOL_EDITOR] later.
If you want to install GRPP from actions or releases, follow these steps:
- Download
GRPP.zipand extractgrpp.tgz. - Open terminal and run the command below:
sudo npm i -g grpp.tgzThere are three ways of compiling GRPP: Easy mode, development mode or production mode.
If you just want GRPP up and running, just run the following command:
npm i && npm run biThis will install all required packages, compile the project and install GRPP system-wide.
In order to compile, run the following commands:
npm i && npm run webpackThe compiled script will be on Build dir.
TIP: You can also run npm run dev - ts will watch all changes on your code and will compile script on the go! In this case, the compiled script will be on App dir instead.
In order to run GRPP, you will need to run like this:
# webpack
node Build/grpp.js
# OR
# Dev mode
node App/grpp.jsFirst, you will need to install all dependencies and compile the project.
To do this, run the following commands:
npm i && npm run buildThis will generate a .tgz file inside Build dir. In order to install, run the following command:
sudo npm i -g grpp.tgzImportant
You MUST run this command as sudo because npm will install grpp globally.
If you don't have superuser access (like non-rooted Android devices), you can run npm run bi-sudoless instead.
If everything is fine, you will be able to call grpp system-wide.
It's simple - just run the following command:
sudo npm remove grppImportant
To know everything GRPP can do, we recommend checking out the command list.
The first thing you need to do is initialize a folder, where it will store it's settings file and all repos.
To do this, run the following command:
grpp --initAfter initializing, you will be able to start importing git repos.
There is some ways you can do this: By importing them one by one, a repo list or even all repos from a specific user.
To do that, you can use the --import= command with your desired git url:
grpp --import=http://github.com/themitosan/grpp.gitIf everything is fine, you will be able to import this git repo to your current location organized by host/user/repo.
(On this case, grpp.git will be located on YOUR_CURRENT_PATH/repos/github.com/themitosan/grpp.git)
You can import a list of repos from a text file! In order to do this, you can use the following command:
grpp --importList=YOUR_GIT_REPOS_LIST.txtDoing that, all repos on YOUR_GIT_REPOS_LIST.txt will be imported to your current path.
Important
Make sure there is only one git url per line!
Since common git hosting websites (like GitHub or GitLab) API's allows fetching user data, GRPP is capable to get all repos from a selected list of users and importing them!
In order to do that, you can use the following command:
grpp --getReposFrom=USERNAMEYou will be prompted asking where GRPP should seek USERNAME repos.
After selecting one of selected options, it will display all repos from the provided user and asking if you want to import.
Important
Since some git hosting websites limits each ip that fetches data very often, GRPP is configured to fetch only 500 repos per user (100 repos per fetch).
If you want to start fetching data from a specific page or fetch a specific number of pages, you can use these commands below:
# Fetch 10 repo pages (Default: 5)
grpp --setMaxFetchPages=10 --getReposFrom=themitosan
# Set start fetch page to 4 (Default: 1)
grpp --setStartPage=4 --getReposFrom=themitosanThere is two ways of doing this: by updating a specifc repo or by updating all at same time.
To update a single repo, just run the following command:
grpp --update=[PATH_TO_GRPP_REPO]This is where GRPP shines! To update all repos, run the following command:
grpp --batchThis will create a determinated number of processes, updating all repos that can be updated on GRPP.
To set the number of processes running, you will need to divide the number of repos that will be updated per process.
Example: Let's just say that you have 100 repos on your database. If you want 4 processes, you can run the following command:
grpp --maxReposPerList=25This will create four processes, each updating 25 repos.
After processing all repos, GRPP will show the update results and save a copy on Logs dir.
Some code snippets from internet were used on this project. You can see all of them listed below:
- Console text color sheet
- Original snippet that changes terminal window title
- Original INI Parser
- Original DNS internet check
- Original snippet to format time in hhmmss
- Original snippet to convert array in smaller chunks
- Original snippet that clears console + history
Some parts of this software derivates from TMS Engine source code.
