Reforking the GitLab Project

From Eigen
Revision as of 16:44, 15 October 2021 by Cantonios (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Due to an incident that occurred on October 2, 2021, all GitLab fork relationships to the main Eigen project created before that date have been severed. This will prevent users from creating new MRs from these severed forks, and from reopening old ones.

Fortunately, there is a way via the GitLab API to re-establish the fork connection.

  1. Create a personal access token (documentation)
  2. Determine your local project's ID.
  3. Use the GitLab REST API to delete the existing broken fork relationship, and re-add it.

Bash:

export PRIVATE_TOKEN=Jk6S1gE8ryA8fy3zgtsj  # <-- Replace with your token.
export PROJECT_ID=17989470                 # <-- Replace with your Project ID.
export EIGEN_PROJECT_ID=15462818
 
# Delete existing fork.
curl -H "PRIVATE-TOKEN: $PRIVATE_TOKEN" -X DELETE \ 
    https://gitlab.com/api/v4/projects/$PROJECT_ID/fork
 
# Re-establish fork.
curl -H "PRIVATE-TOKEN: $PRIVATE_TOKEN" -X POST \
    https://gitlab.com/api/v4/projects/$PROJECT_ID/fork/$EIGEN_PROJECT_ID

Windows Command Prompt:

:: # Replace PRIVATE_TOKEN and PROJECT_ID with your values.
set PRIVATE_TOKEN=Jk6S1gE8ryA8fy3zgtsj
set PROJECT_ID=17989470
set EIGEN_PROJECT_ID=15462818
 
:: # Delete existing fork.
curl -H "PRIVATE-TOKEN: %PRIVATE_TOKEN%" -X DELETE ^
    https://gitlab.com/api/v4/projects/%PROJECT_ID%/fork
 
:: # Re-establish fork.
curl -H "PRIVATE-TOKEN: %PRIVATE_TOKEN%" -X POST ^
    https://gitlab.com/api/v4/projects/%PROJECT_ID%/fork/%EIGEN_PROJECT_ID%

Windows Powershell

$PRIVATE_TOKEN="Jk6S1gE8ryA8fy3zgtsj"  # <-- Replace with your token (in quotes).
$PROJECT_ID=17989470                   # <-- Replace with your Project ID.
$EIGEN_PROJECT_ID=15462818
 
# Delete existing fork.
curl -H "PRIVATE-TOKEN: $PRIVATE_TOKEN" -X DELETE `
    https://gitlab.com/api/v4/projects/$PROJECT_ID/fork
 
# Re-establish fork.
curl -H "PRIVATE-TOKEN: $PRIVATE_TOKEN" -X POST `
    https://gitlab.com/api/v4/projects/$PROJECT_ID/fork/$EIGEN_PROJECT_ID