Skip to content

kaufmann-dev/BashScripts

Repository files navigation

BashScripts

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

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.

Syntax

./gh-clone.sh --user <username> [--visibility <all|public|private>] [--limit <number>] [--into <directory>]

Options

  • --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).

git-push.sh

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.

Syntax

./git-push.sh [--force]

Options

  • --force (optional): Forcefully pushes changes to Git repositories, overwriting remote branches if necessary.

git-info.sh

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.

Syntax

./git-info.sh

Options

  • --repo <repository_name> (optional): Specifies a single repository to analyze, instead of analyzing all repositories in the current directory.

git-add-mit.sh

Iterates through Git repositories found in the current directory and creates or overwrites an MIT license file with a given copyright holder's name.

Syntax

./git-add-mit.sh

Options

  • --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.

git-rename-authors.sh

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.

Syntax

./git-rename-authors.sh --name <new_name> --email <new_email> [--force]

Options

  • --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.

About

A collection of Bash scripts designed to manage and manipulate Git repositories.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages