开发者

Detecting File Changes in TFS

Using the Source Control Explorer for TFS in Visual Studio, is there 开发者_运维百科a way to detect local changes to files (or even new files in the directory hierarchy) that weren't first checked out?

We have a highly disconnected setup at my current client whereby accessing TFS means being on a specific VPN, which breaks connections to other things (such as internal database servers and any web access). So any time a file needs to be modified we need to connect, check out, disconnect, which leads to what I feel is a derailing mental context switch for the developer (especially when working with a lot of files and not knowing ahead of time which ones are going to need to be modified).

We can just work locally and select "Overwrite" any time Visual Studio asks us what we want to do with various non-checked-out files. But then is there a way to detect what files have been changed (or at least made writable) when we want to sync back with the server?

Or maybe I'm going about this all wrong? Backing up a step, what's the ideal way to work on a solution that's bound to but disconnected from TFS source control?


Since David's suggested this might work in his comment, here are the instructions for disabling the remote gateway on the VPN connection. (admittedly this makes it a bit more of a "SuperUser" answer, even if the question was StackOverflow...)

  • Open the "Network and Sharing Centre"
  • Click "Change adapter settings" (on the left)
  • Right-click your VPN connection & select "Properties"
  • On the "Networking" tab, select the IP4 protocol ("Internet Protocol Version 4") and click Properties
  • Click "Advanced"
  • On the "IP settings" tab, untick "Use default gateway on remote network"
  • Click "OK" on everything

I think you have to reconnect the VPN for this to take effect, but basically what this does is stops routing all network traffic through your VPN, and only routes through the stuff that it can't find on the regaular connection. Hopefully that'll mean you can see both TFS and SQL at once!

Good luck ;-)


Aside from doing a folder comparison, I don't know of any way to do this.

Have you tried "work offline"? When VS can't find TFS at startup, it asks if you want to work offline. When it gets back in touch, it looks for offline changes, and tries to sync them. Maybe this will help you.


It's been so long that you've probably already figured this out and moved on, but I encountered the same problem and found a work-around solution for the immediate problem.

Microsoft's solution (Check out the files before your go offline) will work going forward, but to actually get your offline changes into TFS when you haven't checked out all the files (seriously, who's going to know exactly which files you are going to be working with in solution with 100's to 1000's of files), all you need to do is:

  1. When you get back to the office, upload your changed files to your online solution ( I make a copy of my solution directory before I do anything).
  2. Disconnect all network connections from your workstation; i.e., unplug your Ethernet cable, or turn off your WiFi.
  3. Start VS2010 and open your online solution.
  4. Wait about five minutes until VS2010 times-out trying to find your TFS server.
  5. When VS asks you to use your solution in offline mode, click "Yes".
  6. Exit VS.
  7. Reconnect to your network; i.e., plug in your Ethernet cable or turn your WiFi back on.
  8. Start up VS and open your online solution.
  9. Open the Solution Explorer.
  10. Select your solution in the solution explorer.
  11. Press the "Go Online" button in the Solution Explorer's tool bar.
  12. The "Go Online" dialog appears. You will see a list of all your changed files. You can right click on each one and compare it to the Latest Version on the TFS server.
  13. Click OK.

Now, going forward, you can check out everything before you start working offline to avoid this hack.

IHTH

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜