Using Git in Eclipse for CSSE230

In CSSE230, we will use a source control system called git. Here is how to checkout and manage a repo using Eclipse's Git plugin.

Note: if you are off campus, it is recommended (for better stability, and to avoid a potential blockage from the firewall) to connect to the Rose VPN before performing these commands.

Step 1: Cloning a Repository

  1. Open Eclipse and go to File > Import > Git > Projects from Git
  2. Select "Clone URI"
  3. Ignore the URI field for the moment, and fill out with the following: The URI field should have been auto-filling as you filled the other fields, and should now read
    ssh://USERNAME@gitter.csse.rose-hulman.edu/srv/repos/csse230-202010-USERNAME
    with your username, of course. Hit Next.
  4. In branch selection make sure "master" is checked and click next.
  5. In local destination, you can configure anywhere you like (Eclipse may require you to use an empty directory.) Probably best to put it in a fresh directory devoted to CSSE230. Click next.
  6. Select "Import existing eclipse projects" and select next.
  7. You should see "WarmUpAndStretching" on the list, make sure it's checked and select Finish.
  8. You should see a folder for WarmUpAndStretching in your project browser.

Step 2: Test Push

Make a change to a file, save, and push it. Here's how:

  1. In the Package Explorer, open WarmUpAndStretching > src > anagram > Anagram.java. Make an edit: say, add a whitespace character, and save.
  2. In Package Explorer, you'll notice a > appear on any part of the project that has been changed since the last pull from master.
  3. Right click on one of these (say, the WarmUpAndStretching folder) and select Team > Commit.
  4. Verify that Anagram.java appears in your list of "Staged Changes".
  5. Add "test push" to the Commit Message.
  6. Select Commit and push.
  7. Note: if there are any files in the project that shouldn't ever be staged for commits (like a .gitignore file), you can right-click and choose "Ignore".

Step 3: Pull

Later, when working on a team project, you will want to pull changes that others have made. You can try it now, but no changes will be made since you have the up-to-date version.

  1. Right click on the project folder and select Team > Pull
  2. You should get the updated files.

Step 4: Let's do this!

You have the basics! Now its time to start working on the WarmUpAndStretching assignment.

Good Advice for Minimal Merge Conflicts