Reputation: 544
This solution is offline. [Team Foundation Server: http://xxxxxxxxxx/tfs/applications] The solution was offline during its previous session and will remain offline.
What kinds of problems would cause the above error? And when this happens, there is no check-in option and trying to save individual files results in a message that says the file you're trying to save is write protected. Do you wish to override? I can still save files by responding "yes." But all this is very confusing and dangerous. What causes this condition?
Upvotes: 2
Views: 1026
Reputation: 155708
What kinds of problems would cause the above error?
I assume you're using a non-git
TFS workspace (i.e. using TFS' old-school centralized source-control service that essentially is Microsoft's not-invented-here take on SVN.
TFS workspaces come in two flavours: "Local" and "Server". A "Local" workspace is kinda like a git repo in that it allows you to make check-ins while working offline but it has limitations. A "Server" workspace requires you to have an active and reliable connection to the TFS server and you cannot make check-ins while disconnected (you can still make changes, of course, but you can't save them to TFS).
I assume you have a "Server" workspace instead of a "Local" workspace, hence the error message.
And when this happens, there is no check-in option and trying to save individual files results in a message that says the file you're trying to save is write protected.
Correct. But you can always remove the Read-only flag on your files in the filesystem and edit the files and do a manual sync to make a TFS check-in after you've reconnected. The files are marked as Read-only because TFS is designed around locking files and checking-out files from source-control, so it wants to discourage you from editing files that haven't been checked-out. If you do edit a file that hasn't been checked-out you can still include it in a check-in but you need to retroactively check it out when you reconnect to the TFS server.
I can still save files by responding "yes." But all this is very confusing and dangerous.
It's not really dangerous - the whole point of a version-control system is to get the freedom to make arbitrary changes and be able to rollback (or branch) whenever you want (except doing so using TFS rather than git
(especially when offline), is just a rather huge PITA).
To resolve this situation:
git
mode:
Here's a screenshot from Visual Studio 2008 (it's the only screenshot I could find, sorry - but the menu layout is identical):
After you've done this and made your check-in, it's very important that you visit your local fishmonger and buy a large trout, then visit your project manager and give them a jolly good slapping with it for requiring their team to use TFS in 2020. Even Microsoft uses git internally.
Upvotes: 3