How Do You Unlock a GitHub Repository when You Only Know Its Name?

Problem scenario
You want to unlock a GitHub repository. You know the name of the repo. (When you browse to it in a web browser, you see that it is locked, and you cannot see the files inside as normal.) How do you unlock it?

Solution
You need to find the migration GUID for the locked repository. Then you need to run a command on it. For general information about GitHub Enterprise migrations and using Dockerfile, see this external page.

1.a. Run a command like this (but substitute /var/log/github/ghe-migrator.log with the path to the file that is the GHE migrator log):

cat /var/log/github/ghe-migrator.log | grep -i nameofrepo

In the results of the above or in the log file itself, mentally identify the GUID for the repository.
For more information about this file, see https://ppouliot.github.io/dockerfile-ghe-helper/#gheghe-migratorlog

1.b. If nothing shows up in that command, it may be that the migration used a list of URLs. (We think that consuming a list of URLs has different logging from running ghe-* commands individually.) In this case, you will have to exhaustively search:

Run "ghe-migrator list" to show all the GUIDs. (Taken from https://enterprise.github.com/releases/2.15.4/notes.)

Run this (but substitute abcd1234 with a GUID found in the results above):

cat /var/log/github/ghe-migrator.log | grep abcd1234

Continue until you see results with the name of the repository that you are looking for.

  1. Finally run a command like this (where abcd1234 is the migration GUID found above):
ghe-migrator unlock -g abcd1234 -u jdoe -p goodpassword

# Above command was adapted from 4:08 of this video: https://www.youtube.com/watch?v=Vsyncm9cJuA
# Which is close to https://docs.github.com/en/enterprise-server@2.20/admin/user-management/migrating-data-to-your-enterprise

Leave a comment

Your email address will not be published. Required fields are marked *