Skip to content

Instantly share code, notes, and snippets.

@devinschumacher
Last active May 12, 2024 06:58
Show Gist options
  • Save devinschumacher/d5fdf0edf2719f000e6f52e807ec928f to your computer and use it in GitHub Desktop.
Save devinschumacher/d5fdf0edf2719f000e6f52e807ec928f to your computer and use it in GitHub Desktop.
Bulk Transfer Github Issues to Another Repository

How to Bulk Transfer Github Issues to Another Repository

Watch the video

Click to watch the video 👆



Here’s a simple command you can run in your terminal to transfer all the issues from one Github repository to another!

Pre-requisites:

  1. Make sure you have Github CLI installed:

$ brew install gh - (Mac)

  1. Make sure you are “authenticated” through Github CLI:

$ gh auth login

  1. Make sure that the repository you’re transferring from & to have the same labels, fields, etc.

NOTE: I didn't actually test step #3 above... maybe it's not a problem.

Just test it first if you're worried and LMK in the comments if it matters!

Now you’re ready to bulk transfer your issues!

Bulk Transfer your Issues CLI

  1. Open your terminal & run the command below

Just make sure to replace the `organization/repository` name syntax with the ones that you want.

In my example, those are:

  • devinschumacher/repository-a
  • devinschumacher/repository-b -R devinschumacher/repository-a
gh issue list -s all -L 500 --json number -R devinschumacher/repository-a | \
    jq -r '.[] | .number' | \
    while read issue; do
        gh issue transfer "$issue" devinschumacher/repository-b -R devinschumacher/repository-a
        sleep 2
    done

That’s it!


Bulk Transfer Github Issues to Another Repository
@devinschumacher
Copy link
Author

Subscribe for more awesome stuff! - https://serp.ly/@devin/email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment