This repository contains the glh.py file, a versatile Python script designed to streamline the process of managing GitLab repositories.
Before running the script, make sure you have the following:
- Python 3.x installed
- Git installed
To use the glh.py script, follow these steps:
- Clone this repository to your local machine.
- Open a terminal or command prompt.
- Navigate to the cloned repository directory.
- Create a
glh.inifile with the following content:[gitlab] url = https://your-gitlab-url user = your-username private_token = your-private-token
- Run the script using the following command:
./glh.sh
- Use the command-line arguments to specify projects or groups to clone, or clone all:
./glh.sh --projects project1,project2 ./glh.sh --groups group1,group2 ./glh.sh --all
To use the glh.sh script from anywhere on your system, you can add it to your bin directory:
- Move both the shell script and the Python script to your
bindirectory:mv glh.sh /usr/local/bin/glh mv glh.py /usr/local/bin/glh.py
- Make sure the scripts are executable:
chmod +x /usr/local/bin/glh chmod +x /usr/local/bin/glh.py
- Now you can run the script from anywhere using:
glh --projects project1,project2
The script expects the configuration file to be located at ~/.glh/glh.ini on Linux and other Unix-like systems, or ~\\.glh\\glh.ini on Windows. If the configuration file does not exist, the script will create one with generic values and prompt you to update it.
To update the glh.py script and the wrapper:
- Navigate to the cloned repository directory:
cd /path/to/cloned/repository - Pull the latest changes from the repository:
git pull origin main
- If there are updates to the wrapper script, move both scripts to your
bindirectory again:mv glh.sh /usr/local/bin/glh mv glh.py /usr/local/bin/glh.py chmod +x /usr/local/bin/glh chmod +x /usr/local/bin/glh.py
This script supports both Windows and Linux systems.
This script does not work with GitHub, and there are no plans to support GitHub.
I'm not opposed to it, but because GitHub is not FOSS, I'm not very interested in building tooling for that. If you're viewing this project on GitHub: this repository is only a mirror. Forks and Pull Requests are welcomed! GPLv3 attribution(s) required where applicable.
This project is licensed under the GPLv3 License.
