Skip to content
Brad White edited this page Jan 13, 2016 · 9 revisions

Working with Forks

In GitHub, a fork is "a personal copy of another user's repository that lives on your account." The material on this page is adapted from the GitHub documentation, for use with Eclipse.

Configuring a remote for a fork

This section will describe how to configure a remote for a fork in Eclipse. For instructions on how to do this from a Git command line, see the GitHub documentation.

A remote repository is a version of your project that is hosted on the Internet or network somewhere. If you followed the steps to set up Eclipse with Tincr, you will be interacting with two remote repositories: the official repo hosted at https://github.com/bradselw/tincr and your own forked copy. Additionally, there is a local (not remote) repo that you have cloned to your machine.

You will probably want to keep your local and forked repos in sync with the original so that you can receive updates that have been pushed to the original. The way to do that using Eclipse is to configure a remote for the official repo:

  1. In Eclipse, open the Git Repositories view
  2. Right-click on the root of the local repo
  3. "Team" -> "Show in Repositories View"
  4. In the Git Repositories view, create a remote
  5. Expand the tincr element
  6. Right-click on "Remotes" -> "Create Remote..."
  7. Configure the remote
  8. Remote name: official
  9. Select Configure fetch
  10. Click "OK"
  11. Click "Change..." next to "URI"
  12. URI: https://github.com/bradselw/tincr.git
  13. Leave default values for all other fields (User and Password should be your GitHub credentials)
  14. Click "Finish"
  15. Click "Save and Fetch"

Merging an upstream repository into your fork

This section describes how to merge changes from the official repository into your fork from Eclipse. For instructions on how to do this from a Git command line, see the GitHub documentation.

To get the changes from the official repo into your forked repo, you will need to first merge the official repo to your local repo and then push the changes to your forked repo:

  1. Merge the upstream repo with your local repo
  2. In Eclipse, right-click on the root of the local repo (in Eclipse, it is the "project" you created when you installed Tincr)
  3. "Team" -> "Merge..."
  4. Expand "Remote Tracking"
  5. Select the remote and branch (i.e. "official/master")
  6. Leave other options at default values
  7. Click "Merge"
  8. Push the changes to your fork
  9. In Eclipse, right-click on the root of the local repo
  10. "Team" -> "Push to Upstream..."
Clone this wiki locally