Skip to content

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.

RuiOkazaki/github_repo_transfer.sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages