Eclipse and egit

“egit” is a free plugin for Eclipse that allows you to connect to the GIT version control system. Once connected, you can view annotations associated with code changes on a line by line basis. When working in large teams it is often important to determine why a line changed before you make your own changes.

“egit” allows you to see who changed the line in question with their commit message. On the project I am currently on, there is usually a list of 5 – 10 people and commit messages for each line of code.

to install “egit”, pull down your help menu and select “eclipse marketplace”. Type “egit” into the search bar and then click on the install button. Once the plugin is installed, you will have to restart eclipse as well as close and re-open the project. I suggest that you enable line numbers if you haven’t done that already. To enable line numbers, select “preferences” from your eclipse menu. Then select text “text editors” and select the check box for line numbers”. This is important because hovering over a line number in your eclipse editor will display a pop-up with the annotations for that line.

You will need to click right on your editor, select “team” and then “show annotations” on each file in your project where you want annotations displayed. Each annotation shows the GIT hash that you can use to checkout the build associated with the specific change. If you use an application crash tracker like “Critterism”, it is important to get back to the build associated with the stack trace in order to have the line numbers make sense.

Definitely a useful tool in your arsenal.

This entry was posted in Uncategorized and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *