In this article

Share your code in Git using Eclipse

In this article

VSTS | TFS 2018 | TFS 2017 | TFS 2015

Prerequisites

A VSTS account. If you don't have one, you can sign up for one for free. Each account includes free, unlimited private Git repositories.

Use Team Explorer Everywhere

Team Explorer Everywhere is an open-source Eclipse plug-in to connect Eclipse to VSTS or Team Foundation Server. If you're working with VSTS/TFS and Eclipse, use this plugin to connect to your repos, builds, and work items.

Add the Team Explorer Everywhere view in Eclipse. Go to Window, Show View and select Other... Search for Team Explorer, select the Team Explorer view, and select OK.

Connect to VSTS

In the Team Explorer Everywhere view, select Connect to VSTS or a Team Foundation Server .

If you know your VSTS or Team Foundation Server account URL, select the Servers... button under Connect to a Team Foundation Server or VSTS account to add your TFS server or account to the drop-down list.
If you don't know your account information for VSTS, select Browse Visual Studio Services and select Next.

Either choice will prompt for your credentials before continuing further.

Select the project where you will share your code from the Project Selection dialog and select Finish.

Create a local Git repo for your Eclipse project

Before you can push your project to VSTS, you need to add it to a local Git repo.

Push your project to your VSTS/TFS repo

In Team Explorer Everywhere, select Git Repositories, then right-click the empty repo you want to push your Eclipse project to and select Copy Clone URL. If you don't have an empty Git repo created in VSTS/TFS yet, you can create one using these instructions.

In Package Explorer, right-click your project and Select Team, Push Branch ... . Paste the clone URL from the clipboard into the URI field and select Next. Make sure Configure upstream for push and pull is selected in the next window and select Next.