Chapter 5. Making changes to Saros

Table of Contents

Cleaning your working copy
Reverting local modifications
Deleting untracked/new files
Downloading a change
Downloading a change (textual)
Downloading a change (graphical)
Doing your first change
The first change (textual)
The first change (graphical)
Understanding build failures
Dealing with feedback
Updating your changes
Fetch, Rebase and Push
Advanced Git Topics
Cherry-pick
Staging Changes
Tasks during a release
Pushing to a non default branch (textual)
Pushing to a non default branch (graphical)

This chapter will show you how to work with EGit and Gerrit in the most common cases. This includes testing the code of someone else, making your first change, editing your change after having received review, updating your change to apply against the latest version of Saros. This will conclude with more advanced usage of having a chain of changes that build on top of each other and being asked to modify a change that is in the middle. This does not replace taking a look at the rather lengthy Eclipse EGit Wiki.

Cleaning your working copy

You might have created new classes and they are not under version version control yet and now you would like to switch the branch. Files not under version control will not be removed when switching branches. In some cases this might not be what you want and you could create a work in progress commit with the new files and later amend the commit with more changes and a better Git commit message. The other option is to remove files and this is what will be handled now.

Reverting local modifications

The easiest way to revert your un-comitted modifications is to use the Git reset feature. You want to use the hard option. This will reset the last commit of your history to the selected commit and will modify your working directory to match this commit.

Procedure 5.1. Git reset hard (text)

  1. Enter the context menu and select TeamReset.

  2. Select the branch/last commit. The default is the last commit. Select hard as the reset type.

  3. Confirm the reset option.

  4. The package explores does not indicate any modification.

Procedure 5.2. Git reset hard (graphical)

  1. Enter Contextmenu

  2. Select reset type

  3. Confirm

  4. Clean tree

Deleting untracked/new files

The Git reset feature does not remove files that are not under version control. The Team Synchronizing perspective will show you files not under version control. You can easily delete these files in this perspective.

Procedure 5.3. Deleting untracked files (textual)

  1. Use the Contextmenu and then TeamSynchronize Workspace.

  2. Confirm moving to the Team Synchronizing perspective.

  3. Select the files you want to remove and use the Contextmenu to delete them.

Procedure 5.4. Deleting untracked files (graphical)

  1. Enter Contextmenu

  2. Switch perspective

  3. Delete files

  4. Confirm

  5. No changes left