This is the second post in how to setup TFS and Eclipse to use git. Before you continue here make sure you’ve setup TFS properly as described here. I also assume here that you’ve already installed egit as a plugin in Eclipse.
- Create a new local project in Eclipse (
Local PHP Projector something similar)
- Right-click the newly created project and select
- Select Git in the window opening up
- If you don’t have any repository to use then click on
Createto create a new one
- Mark some file(s) to be included by the repository (Right-click a file/folder and select
Add to index) and make an initial Commit to the local repository to see that everything is working. This can be done by clicking
#or by opening the
- Open the Git Repository overview. If you don’t have it available then click on
Get Repositoriesunder the Git section.
In the Git Repository overview select your newly created repository and right click on the Remotes folder (which should be empty if it’s a new repository).
Create Remoteand then select
- In the next window that shows up click on
Changenext to the empty read-only URI box.
- Paste in the URI given from TFS when setting up the TFS Git repository (see previous post), add username and password and click
- Now when the URI is set you can click on
Save and Pushto push your initial Commit to the TFS server.
- The result is presented in a status box.
- If you go back to the TFS page and look under the Code section you’ll find the new code you’ve just pushed from Eclipse.