Share your Eclipse projects(Eclipse與Visual Studio Online的協同工作)




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

Connect to Visual Studio Online

  1. If your team doesn't already have a team project, create one.

  2. If you haven't already, install the Team Explorer plug-in for Eclipse: http://dl.microsoft.com/eclipse/tfs. Show me how.

  3. Show the team explorer views.

    Windows menu, show view, other

    You'll just use the team explorer here.

    Show View dialog box, Team Foundation Server expanded, Pending Changes and Team Explorer selected 
  4. In the team explorer view, connect to Visual Studio Online.

    Pending changes view, Connect to Team Foundation Server link 
  5. Configure the servers.

    Add Existing Team Project dialog box, Servers button 
  6. Add the server.

    Add/Remove Team Foundation Server dialog box, Add button 

  7. Provide the URL to your Visual Studio Online account (http://[account].visualstudio.com).

    Add Team Foundation Server dialog box with the server URL specified 
  8. Connect to the team project.

    Add Existing Team Project dialog box, with the collection and project selected 

Share your code

  1. In the package explorer, share your project.

    In the package explorer, the project's context menu, Team, Share Project
  2. Share your project in Team Foundation Version Control.

    Share project dialog box,. Team Foundation Server selected 
  3. In the pending changes view, check the project in.

    Pending changes view, check in button 
  4. Go to the team home page.

    World wide web icon in the team explorer

    On the code tab, you'll see your code.

    Team project home page, code tab with the project in TFS

Q&A

Q:Should I use Git or TFVC for my team project?

A:You can build your Eclipse projects in Visual Studio Online as long as your team project uses TFVC. If you use Git, you'll have to use you own build server. A number of other factors, like the size of your codebase and the size and distribution of your team, may also impact which is best for your team.

Q:How can I share my code in a Git repository instead of TFVC?

A: Set up a team project that uses Git for version control, then clone the Git repository and Git in Eclipse to share your code.

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 user profile page 
  3. Set the password for the user name that you use to sign in to Visual Studio Online.

    Alternate credentials enabled in the user profile page 

Clone the repository

  1. Show the Git views.

    Windows menu, show view, other

    You'll use the repositories and staging views here.

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

    If 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 in the Git repositories view  
  3. Specify the URL for your team project (http://[account].visualstudio.com/DefaultCollection/_git/[team project]).

    Clone Git repository dialog box with team project URL and 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 dialog 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 
  3. You'll see how the remote repository is mapped to your working directory.

    Configure Git Repository dialog box 
  4. In the Git staging view, add your files to the Git index.

    Get staging view, unsaved changes context menu, add to Git index  
  5. Push the source to the remote repository.

    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].visualstudio.com/DefaultCollection/[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 icon selected to show the URL

轉自:

http://www.visualstudio.com/get-started/share-your-eclipse-projects-vs


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章