Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page is for Eclipse users who are trying to master using EGit in the Robot Lab workflow.

Documentationhttp://wiki.eclipse.org/EGit/User_Guide#Getting_Started

Referencehttp://wiki.eclipse.org/EGit/User_Guide#Reference

Info
titleINSTALL ECLIPSE NEON

This article assumes using Eclipse Neon.1 which has built in Gradle and Git support. https://eclipse.org/downloads/

Table of Contents

Keep Plugins Up To Date

Info
titleNOTICE

 We DO NOT USE the Marketplace for plugins anymore. Please reinstall your plugins from the update sites here: Installing plugins in Eclipse

You want to make sure to keep Buildship and EGit up to date, including Gitflow support.

Image AddedImage Added

Uninstall Old Plugins

Image AddedImage Added

Configuration

Ensure autocrlf=false.

Image AddedImage Added

DO NOT SET 'core.eol'!

Image Added

I'm not sure how important these cache options are, but these are the settings of the author.

Image Added

Make sure you are refreshing using native hooks, polling, and on access. Ensure UTF-8 encoding and Unix line endings.

Image Added

Synchronizing

A fully up to date workspace with no incoming or local changes looks like this:

Image Added

Image AddedImage Added

ViewDescription
SynchronizeViews the diffs between two branches, in most cases, your local develop and remote develop. You have the option to include also your uncommitted changes.
Git StagingWhere you make commits. Add unstaged changes to index (staged), enter a commit message and commit. Careful, commit and push will send your commit to the remote!
Git RepositoriesShows all the repositories you have cloned locally. Use this window to push and pull from individual repos, create branches, and other advanced Git operations.
History

Shows a history of all the commits that changed the selected file.

Rebase InteractiveHelps you step through commits as you rebase them onto the remote branch.

Setting Up Synchronize

Image Added

Image Added

Image Added

Set all Destinations.

Don't forget to check 'Include local uncommitted changes in comparison'.

Then, check 'Java Workspace':

Image Added

Here is a reference for what the little icons mean.

Image Added

Setting up History

Make sure to check 'Show All Branches and Tags':

Image Added

Making a Commit

We make a change to FileTools.java:

Image Added

Then this happened:

Image Added

You can see the Java file changed in the project, and the Git commit process has been initiated. To proceed add FileTools to Index.

Image Added OR Image Added OR Drag it into Staged Changes.

And now the change is staged (I have also added a commit message):

Image Added

Image Added Click commit.

Our commit is now ready:

Image Added

Quick Commit

To perform a quicker style commit, right click and select Commit on a changed file.

Image Added

Add and commit message a check or un-check the files you want the commit to contain. You also have the option to commit and push in one click.

Image Added

Doing a Push

There are two ways to push:

Image Added Push to a single repository in 'Git Respositories' view.

Image Added DO NOT USE THIS PUSH BUTTON. It is very dangerous and could push more than you want.

Undo/Reset/Overwrite a Change

Image Added

Doing a Fast-Forward Fetch and Rebase

Image Added

Rebase on origin/develop:

Image Added

Doing a Fast-Forward Pull

Image Added Pull from all repositories.

Doing a Pull With Rebase

Image Added First, you need to set Pull to 'Rebase' mode.

Image Added

Do a pull. If you have local commits, you see this:

Image Added Upon pulling, you get Result: Stopped.

Image AddedThe repo will show 'Rebase w/ merge'.

Image Added

Resolve the conflicts in your file and mark them as Merged.

Image Added

Image Added Continue rebase.

Image AddedImage AddedImage Added

Doing a Reset

Say you make some changes that you want to reset before you have pushed them.

Here I have made a commit and then made some additional changes to the same file:

Image Added

In Git Repositories view we Reset:

Image Added

Two things are important. Reset to origin/develop and select Mixed to not overwrite your working tree. Select Hard to overwrite all local changes.

Image Added

Result:

Image Added

Stashing Changes

If you need to pull but you have conflicts, stash your changes, pull, then apply stashed changes. This is essentially a simplified rebase.

Image Added

Image Added

Advanced Operations

Doing a Squash

Find the commit below any commits you would like to squash in your local repository's history:

Image Added

Select 'Rebase Interactive':

Image Added

Image Added

Find your 'Rebase Interactive' view:

Image Added

Select 'Squash' on the latest commit ('Pick' on the other):

Image Added

Click 'Start':

Image Added

Rewrite your commit message:

Image Added

Click okay:

Image Added

Bugs and Workarounds

Items get stuck in Synchronize View

Sometime conflicting additions or conflicting moves that don't actual exist. will get stuck in the Synchronize View. The only way the flush them is to delete the Synchronization and make a new one.

Image Added

Image Added

Imported Gradle Projects Aren't Detected As Git Projects

In Git Repositories view, import local repositories cloned by Hephaestus.

Image Added