RuiOkazaki / github_repo_transfer.sh

Shell script to transfer all repositories of a specified user to a specified organization on GitHub. The script uses GitHub CLI to list all repositories of the user and then uses GitHub API to transfer each repository to the organization.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub Repository Transfer Script

This shell script transfers all repositories of a specified user to a specified organization on GitHub. The script uses GitHub CLI to list all repositories of the user and then uses GitHub API to transfer each repository to the organization.

Prerequisites

  • Bash shell (Unix environment)
  • GitHub CLI installed and authenticated
  • jq command-line JSON processor
  • curl command-line tool for making HTTP requests

Usage

  1. set variables in github_repo_transfer.sh
user_name=""
org_name=""
# https://github.com/settings/tokens -> Generate new token
token=""
  1. run script
$ sh github_repo_transfer.sh

Warning

This script transfers the ownership of your repositories to another organization. You will lose admin rights to these repositories unless you are an owner of the organization. Please use this script responsibly and double-check the organization name before running the script.

About

Shell script to transfer all repositories of a specified user to a specified organization on GitHub. The script uses GitHub CLI to list all repositories of the user and then uses GitHub API to transfer each repository to the organization.


Languages

Language:Shell 100.0%