This and That: Using Git in Eclipse

Git is a widely used version control system. (You most likely heard of GitHub.) This page guides you through setting up Ecplise so that it can work with projects hosted on GitHub.

EGit plugin comes bundled with the latest versions of Ecplise. It allows you to use git with the projects created in Eclipse.


There is a great tutorial with lots of details at the Vogella tutorials site: Git version control with Eclipse (EGit).




Here are just some quick points on how to get started with using the EGit plugin in Eclipse.

Help documentation for EGit

Open an instance of Eclipse and go to HelpHelp ContentsEGit Documentation.

Configure Eclipse and Git

You need to configure Eclipse and Git so that the version control system knows who you are when you are making changes to the repositories. In Eclipse go to WindowsPreferencesTeamGitConfiguration. You should be looking at the screen that looks as follows:

You can read more about configuring git in general at Getting Started - First Time Git Setup.

Place for your repositories

Eclipse keeps a lot of files in addition to the source code files for the project that we are working on. We want a different location for the repositories that should contain the source code (and optional README files) only.

To set this up, go to WindowsPreferencesTeamGit and change the directory name for Default repository folder. Some good locations might be your home directory, a directory in which you store course related materials, etc. In my case, it is /home/asia/Data/NYU_Teaching/csci102/git (in Linux, /home/asia is my home directory).