CSC Git Guide

Sharing an Existing Java Project to your Repository

Sharing an Existing Java Project to your Repository

This section describes what to do if you have already been working on a Project locally within Eclipse, but have not shared it to your git repository yet.

When you think your existing Eclipse project is in a good state to commit a snapshot of it to your git repository, you need to tell Eclipse which git repository to send your code to.

  1. In Eclipse, right-click your project in Package Explorer.
  2. Choose: Team -> Share Project.

Figure: Sharing an Eclipse Project to Your Git Repository

  1. Select the correct git repository from the drop-down. If no repositories are listed, double-check that you have cloned your NCSU GitHub repository correctly.

Figure: Selecting a Git Repository

  1. Your Git Repositories window should now show your project listed inside your Working Directory.

Figure: Your Project in Repository's Working Directory

Your Eclipse project should now know which git repository it should communicate with.

Use Git Bash to Check that your Project is Connected to your Repository

In Git Bash, execute:

 git status

Figure: Checking the Status of Your Repository in Git Bash

Git now says that your .gitignore file and your ShapeCalculator project directory (and its contents) are currently associated with your repository, but are currently untracked.