Use Git and Xcode with TFS

You can use Git to work in your local repository and then use Git-tf to check code in to TFS when it's ready to share with the team.

Create a Visual Studio account

If your team doesn't have a Visual Studio account, create one.

  1. Create your team's Visual Studio account.

  2. Account creation page
  3. If you're not already signed in with your Microsoft account, you'll do that here.

    Microsoft account sign in page

    If you don't have a Microsoft account, sign up for one.

    First time signing in to Team Foundation Service with your Microsoft account? We will ask you for some extra information so that we can personalize your experience. If our Terms of Service have changed since you last signed in, you may be asked to agree and confirm that your information is up-to-date.

Create a team project

Now you have a Visual Studio account. You can create a team project.

  1. Go to your home page - https://[your account].visualstudio.com - to create a team project.

    Create a project in TFS
  2. Name your project and choose a process template.

    Choose a process template. Visual Studio Scrum 2.0, MSF for Agile, and MSF for CMMI Process Improvement are supported

    The process template defines how you manage your work: as a Scrum project, a general Agile project, or a more formal CMMI style project. Choose the template that's best for your team.

  3. Click Create Project, wait a few moments, and you're ready to go!

    When you click Create Project, everything comes together automatically

    Done. You have your very own Team Foundation Service in the cloud. Now, let's connect it to Visual Studio.

Enable basic authentication for your account

To use Git-tf with your visualstudio.com account, enable basic authentication.

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

    My profile on the team project home page
  2. Allow alternate credentials for this account.

    Enable alternate credentials on the user profile page

    Download and configure Git-tf

    1. Download and extract Git-tf.

    2. Add Git-tf and the Java runtime to your path.

      export JAVA_HOME=/Library/Java/Home
      export PATH=$PATH:$JAVA_HOME/bin:/git_tf

    3. Go to the root of your local repository.

      pushd /ws/FabrikamFiber

    4. To share your Git repository in TFS, configure the connection and check in your code. You'll be prompted for credentials.

      git tf configure https://fabrikamfiber.visualstudio.com $/FabrikamFiber
      git tf checkin

      Or, if your team's code is already in TFS, you can clone a local repository using Git-tf.

      git tf clone https://fabrikamfiber.visualstudio.com $/FabrikamFiber

    5. If you don't want to be prompted for credentials every time you run Git-tf, you can store your credentials in your Git configuration.

      git config git-tf.server.username [email protected]
      git config git-tf.server.password mypassword

    Share your code

     
    1. After you commit changes to your local Git repository, and you're ready to share them in TFS, check them in. If you've committed multiple changes locally, TFS will aggregate the local commits and check the changes in to TFS.

      git commit -a
      git tf checkin

    2. If you're working on a task or fixing a bug that's tracked as a work item, indicate that when you check in. TFS will resolve the bug or close the task, and it'll link the changeset to the work item. That will trace through to things like build reports.

      git tf checkin --resolve=21972

    3. You can make sure you're working with your team's latest code by pulling from TFS.

      git tf pull

      Use git tf help to learn about the Git-tf commands.

      git tf help
      git tf help