Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "GitHub"

(End User required actions)
(Forked repositories)
Line 28: Line 28:
  
 
   $ git fetch origin refs/replace/*:refs/replace/*
 
   $ 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.
 +
 +
  $ git branch -m master old_master
 +
  $ git push origin old_master
 +
  $ git checkout upstream/master
 +
  $ git checkout -b master
 +
  $ git push --force origin master
 +
 +
WARNING: These command will backup master to old_master and then force pushes a brand new master to your GitHub repository.

Revision as of 13:20, 30 July 2013

This page details the required actions to migrating a repo to Eclipse Foundation GitHub.

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:

 $ git checkout origin/master
 $ git branch -m master old_master
 $ git checkout -b 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.

 $ git branch -m master old_master
 $ git push origin old_master
 $ git checkout upstream/master
 $ git checkout -b master
 $ git push --force origin master

WARNING: These command will backup master to old_master and then force pushes a brand new master to your GitHub repository.

Back to the top