Share your Eclipse projects

Connect Eclipse to your Visual Studio account to share your code with your team.

If you don't have a team project that uses Git in your Visual Studio account, create one.

Enable alternate credentials

To use Git with your Visual Studio Online account, enable alternate credentials so that you can sign in from Eclipse.

  1. Go to your team project's home page and open your profile.

    Team project home page, my profile

  2. Allow alternate credentials for this account.

    Enable alternate credentials link on the user profile page

  3. Set the password for the user name that you use to sign in to Visual Studio Online.

    Alternate credentials enabled on the user profile page

Clone the repository

  1. Show the Git views.

    Windows menu, show window, other

    You'll use the repositories and staging views here.

    Show view dialog box, Git expanded, Git Repositories and Git Staging selected

    you don't have the Git views, you can get them by downloading EGit.

  2. Use the Git repositories view to clone the Git repository for your team project.

    Clone a Git repository link in the Git Repositories view

  3. Specify the URL for your team project (http://[account][team project]). Use the alternate credentials that you added for authentication.

    Clone Git Repository dialog box with a team project URL and alternate credentials provided

  4. If you just created your team project, the Git repository will be empty. That's OK.

    Branch selection dialog box showing the empty repository

  5. Specify where you'll keep the cloned repository on your machine.

    Local destination dailog box

    The repository for your team project shows up in the Git repositories view.

    Git repositories view showing the cloned repository

Push your code to the remote repository

  1. In the package explorer, share your project.

    In the Package Explorer, the project's context menu, Team, Share Project

  2. Make sure you share it to Git.

    Share Project dialog box with Git selected

    You'll see how the remote repository is mapped to your working directory.

    Configure Git Repository dailog box

  3. Add your files to the Git index to stage your changes.

    Git staging view, unstaged changes context menu,  Add to Git Index

  4. Push the source to the remote repository using the alternate credentials.

    Commit and Push button in the Git Staging view

    Your code is in your team project's Git repository now. You can open your team project's code page and see the code there.

    Team project code page with the code pushed to the remote repository


Q: What if the Git views don't show up.

A: You can download EGit to use Git with Eclipse.

Q:Where can I find the URL for my Visual Studio-managed Git repository?

A: It's in the team project home page, in the code explorer.

  1. Open the code explorer on your you team project's home page (https://[account][team project]).

    Team project home page, code explorer

  2. With the repository you want to clone selected, get the URL.

    Team project home page, code explorer, clone selected to show the URL

Q: Can I share my code in a team project that uses TFVC?

A: Yes. Use the Team Explorer plug-in for Eclipse.

Try this next

Build your Eclipse projects