Obtaining Modifications from Others

In a shared project, other people with whom the project is shared can make some changes, for example, modify a block, create a new block, or delete an existing one. Their modifications are stored as commits on the remote repository. In the following, we describe how to obtain those modifications.

Step 1. Fetch From Upstream

First, we need to get the commits to our local repository. This corresponds to the red arrow fetch in the figure illustrating EGit.

Follow these steps:

  • In the Git Repositories View, right click the repository containing the shared project.
  • Select Fetch From Upstream.
  • After sometime, you will get a confirmation window that also shows how many commits are fetched.

Step 2. Merge

Then, in order to get the modification into your Eclipse workspace (which also means into the Git working directory the workspace is connected to), we need to merge them to our current checkout version in the working directory. This action is called merge in Git term. It corresponds to the golden arrow merge in the figure illustrating EGit.

Follow these steps:

  • In the Git Repositories, right click the repository containing the shared project.
  • Select Merge.
  • You will get a window similar to the following figure.
    1. Expand folder Remote Tracking and select branch origin/master.
    2. Click button Merge.

  • You will get a window showing the result of the merge action.

Note

By choosing command Pull instead of Fetch from Upstream, the second step will be executed automatically.