Create a Git Local Workspace with Team Foundation Server Using Git-TFS

While Team Foundation Server now also supports local workspaces, where you can check out files and track changes without having a read-only lock on them, there could be possible challenges that may not allow you to use the local workspace mode in TFS. You may already be in the server connected mode and would not make your entire workspace local just for a few artifacts in your solution. This scenario becomes very realistic when you have files tracked by TFS that are not recognized by the Visual Studio ecosystem.

This could also be particularly useful for tracking the history of changes in documents checked into TFS. In any case, git gives you lot of flexibility in cloning a TFS branch and creating a local workspace that you can manipulate without having to worry about tracking the history and then check them back into TFS when you are done making the changes. This is done using the git-tfs?tool that acts as a two way bridge between TFS and git. You can download the tool from the site and then use the git shell to execute the commands.

  1. To create a clone use the command git tfs clone [TFS Branch URL] [Local Workspace Folder]
  2. To get latest use the command git tfs pull
  3. To check-in git tfs checkin

Before you can successfully check-in to TFS and merge the changes from your local repository you will have to issue additional git commands to ensure the changes are recognized part of your local git repository.

To verify the status of pending changes you can use git status. To include the changes part of your commit, use git add and then git commit.

If you are not a big fan of using the git command shell and want a GUI for managing the local repository, you can also use the Visual Studio Team Client for git that is available in your team explorer, if you are using Visual Studio 2013 premium. You can use it to clone a repository from TFS and then start syncing your changes from the local repository to TFS. Once you have made any changes to the local repository, they will show up in the explorer and then you can use the commit command to commit your changes. Once you have committed, use the sync command to publish your changes back into TFS.

This provides an interesting alternative to using local workspaces in TFS and you can create as many local workspaces you need!

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

The Latest

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a

chrome os developer mode

How to Turn on Chrome OS Developer Mode

Google’s Chrome OS is a popular operating system that is widely used on Chromebooks and other devices. While it is designed to be simple and user-friendly, there are times when users may want to access additional features and functionality. One way to do this is by turning on Chrome OS

homes in the real estate industry

Exploring the Latest Tech Trends Impacting the Real Estate Industry

The real estate industry is changing thanks to the newest technological advancements. These new developments — from blockchain and AI to virtual reality and 3D printing — are poised to change how we buy and sell homes. Real estate brokers, buyers, sellers, wholesale real estate professionals, fix and flippers, and beyond may