Migrating a GitHub repo to Eclipse Foundation GitHub organization

Make sure IP team has cleared the Initial contribution, and project has TAGged the initial contribution in the repo

Step 1 - Create new branches and tags with namespace /_old/

Since the Eclipse IP team does not perform a code review on historical code, we must move history to a different namespace. This will allow the Eclipse Foundation to maintain a mirror of the GitHub repository on its servers, without the historical content.

Below, URL implies the SSH url that you can (eventually) push back to.

$ git log # should now show all the old history, not just the initial commit

NOTE: End user must additionally run (if they want the history): git fetch origin '+refs/replace/*:refs/replace/*'

End User required actions

If a user had previously cloned the repository before it was moved to the Eclipse Foundation GitHub organization, the move will have caused a few issues to the user’s local repository. The easiest option to resolve the issues is to just do a brand new git clone of the repository from the new location. If however this is not an option below outlines issues that the user will run into and steps to resolve the issues.

Update repository URLs

The origin remote will need to be updated to point to the new URL.

$ git remote set-url origin git@github.com:Eclipse/project.git

Fix master branch

The user’s master branch will still be based on the old master branch and needs to be changed to the new master.

The following commands will rename the local master to “old_master” and create a new master based on the new upstream master:

Repeat these steps for any other additional branches that may have conflict.

(Optional) Git Replace history

If the user would like to see the old history attached to the new Initial Commit they can checkout the refs/replace/* refspec.

$ git fetch origin refs/replace/*:refs/replace/*

Forked repositories

Forked repositories will have branches that no longer match with upstream due to upstream renaming all the branches to /_old/ prefix. The easiest way to resolve this issue is to refork upstream. However if this is not an option below lists the tasks that will need to be considered in each fork of the project.

Fix master branch

The fork’s master branch and upstream master branches will be different. To fix this the fork owner can rename their original master branch and push a new master branch based on the upstream project’s master.