Welcome to the BashScripts repository! In this repository, you will find a collection of a few useful scripts I have created for the management of git repositories. For all scripts to work, please make sure you have installed gh, git and git filter-repo. This repository contains the following scripts:
gh-clone.sh: Clone multiple GitHub repositories.git-push.sh: Push multiple git repositories.git-info.sh: Display information about git repositories.git-add-mit.sh: Add the MIT license to your repositories.git-rename-authors.sh: Change name and email of authors and commiters.
Clones GitHub repositories based on specified criteria (visibility, user, limit) and organizes them into a designated directory, checking for existing repositories and displaying status messages.
./gh-clone.sh --user <username> [--visibility <all|public|private>] [--limit <number>] [--into <directory>]
--user <username>(required): Specify the GitHub username whose repositories to clone.--visibility <all|public|private>(optional): Set the visibility of repositories to clone (default: "all").--limit <number>(optional): Set the maximum number of repositories to clone (default: 100).--into <directory>(optional): Specify the target directory to organize cloned repositories (default: username).
Iterates through Git repositories found in the current directory and its immediate subdirectories, checks if there are changes to push, and performs a Git push operation with optional force flag.
./git-push.sh [--force]
--force(optional): Forcefully pushes changes to Git repositories, overwriting remote branches if necessary.
Iterates through Git repositories found in the current directory and its immediate subdirectories, and provides information about each repository including name, status, license, branches, remotes, commits and files.
./git-info.sh
--repo <repository_name>(optional): Specifies a single repository to analyze, instead of analyzing all repositories in the current directory.
Iterates through Git repositories found in the current directory and creates or overwrites an MIT license file with a given copyright holder's name.
./git-add-mit.sh
--name <copyright_holder>(required): Specifies the copyright holder's name.--overwrite(optional): If provided, replaces existing LICENSE files instead of skipping them.--repo <repository_name>(optional): Specifies a single repository to create a LICENSE file, instead of all repositories in the current directory.
Iterates through Git repositories found in the current directory and its immediate subdirectories, updates author and committer information, with optional force mode, allowing users to specify a new name and email.
./git-rename-authors.sh --name <new_name> --email <new_email> [--force]
--name <new_name>(required): Specifies the new name to be set as the author and committer in the Git repositories.--email <new_email>(required): Specifies the new email address to be set as the author and committer in the Git repositories.--force(optional): Enables force mode, allowing the script to update author and commiter information even if the repositories do not look like fresh clones.--repo <repository_name>(optional): Specifies a single repository instead of going through all repositories in the current directory.