TFS Folder deleted project - tfs

i have deleted project from TFS but now i see a folder that has no pending changes or anything in it but the name of the folder is now starting as D7311f850 and I can not delete it from the list. Is there a way we can?

This seems to be some cached folder in Visual Studio. You could just try to close VS and clean the client TFS caches, then open visual studio again.
TFS:
C:\Users\{your account}\AppData\Local\Microsoft\TeamFoundation\{version}\Cache
Deleting the folder in TFS will only actually perform a "soft delete". The branch will still exist complete with all of it's history, except it will be hidden. You could show the deleted items in VS follow this tutorial.
If you want to permanently deletes version-controlled files from Team Foundation version control, need to perform a tf destroy command.
tf destroy [/keephistory] <itemspec1>[;<versionspec>][<itemspec2>...<itemspecN>]
[/stopat:<versionspec>] [/preview] [/startcleanup] [/noprompt] [/silent] [/login:username,[password]] [/collection:TeamProjectCollectionUrl]]
If above not work and you do not need the folders any more, you could also destroy the file and clean the cache again.

Related

Synchronise TFS database with workspaces (put not get)

We had a corruption in our TFS database and had to restore it to a previous time. This caused our workspaces to be 'in the future' and our TFS server to be 'in the past'. I tried to do a check in so that VS would update TFS to the latest version but it only checked in the files I had modified since the last check in.
Since the last check-in was after the last backup and is now gone, how do I synchronise TFS so that it has the lastest version which is on my machine?
you will need to perform "add items to folder" action instead of "check in pending changes"
There is probably an easier way but in the past this has worked fairly well.
Make a full copy of your local
Do a complete get latest/force/overwrite
Checkout the entire folder
Overwrite the working folder with your copy
Use a diff tool (or whatever method you want) to do the manual adds/deletes to TFS that won't come in when you copy
Check in the entire folder (only the changed files will mark in history) - a comment like "fixing corruption" is helpful for the future
Files will all be in TFS and up to date. Obviously history/labels/merges/etc are gone.

Complete nuke all changes in visual studio and reset from TFS

I am using Visual Studio 2013. Regarding TFS workflow, there are issues I have when working on a bug or work item, after I am finished, I move the changes into a shelfset for further review, undo my changes by right clicking on the pending changes and clicking undo. The move on to the next issue or enhancement. The shelfsets can be indpendendly reviewed and then applied to whatever branch they are currently needed.
The problem I have is that undoing through visual studio does not completely reset the solution to a completely clean state. There are often orphaned files around or projects that have references to non-existing files or other such problems. I'd like to be able to completely nuke and reset my solutions from source control as if I am a new developer and I have not found an easy solution to do this.
Currently, the only way I can accomplish this is to go to "Source Control Explorer" remove the file system mapping for the project. Go to the file system, removed the folder. Go back into "Source Control Explorer" add the mappings back in. And then "Get Latest Version".
Is there an easy way to completely reset a solution in Visual Studio with TFS?
You can achieve this in Visual Studio 2010 without Power Tools. Process is likely similar for other VS versions.
Open the Source Control Explorer. Right-click the entry you want to reset, then choose "Get Specific Version." Select the version you want to reset to. Ensure that the two checkboxes are checked:
☑ Overwrite writeable files that are not checked out
☑ Overwrite all files even if the local version matches the specified version
This will overwrite all locally mapped files with the server's version. (And will correspondingly take time proportionate to the number of files.) I do not believe that this operation will remove any unmapped files.
If you have the Power Tools installed, call tfpt scorch /deletes /recursive /diff. That should make your local folder match the server exactly.
You can also call tfpt treeclean, which will just delete any item that is not mapped to TFS. It won't update or replace any changed files though, like scorch will.

TFS 2010: How to check in files that were deleted but not deleted through TFS

I have some files in a local workspace that were checked out and then deleted but were not deleted through TFS. TFS still has them marked as "edit" in the pending changes view. When I try to check-in the deleted files, I get an error saying the files cannot be found. Is there a way to tell TFS that these files have been deleted and that they should be deleted in source control as well?
You could, through team explorer, right click on the deleted files and do a undo pending changes. Then through team explorer delete them and check them in.
If that doesn't work - right click on the deleted file through team explorer; do a get specific version and check both checkboxes to overwrite files:
This will fetch the deleted [from workspace] file from TFS. Perform an undo pending changes on the file. Then delete the file through team explorer and check it in.
If there aren't too many files, just create some dummy ones on disk, check them in, then delete them through TFS.
I think you should be able to do this via source control explorer: View -> Other Windows -> Source Control Exlorer. Find the code file that you want to mark as deleted and right-click and select delete.
For future reference, TFS Power Tools is very useful for this kind of thing.

If you use TFS version control, how do you remove a folder?

How does one remove a project from a solution in TFS?
We are using the TFS version control system.
We have a sln file that has lots of projects.
I have removed the project from the Solution Explorer.
But in the "Source Control Explorer" window, the folder containing the project's files are still there.
If I try to delete the folder I want to delete from the "Source Control Explorer" window, and I get an error that says it cannot be deleted. It says that one or more children have pending changes. Well, I have the folder checked out. What else do I have to do?
The files in the project are listed as being checked out.
You cannot pend changes on items and then delete their parent. This prevents data loss - for example, if you were to pend an edit on $/A/file.txt and then delete $/A, you would lose those uncommitted changes. Thus, you must explicitly undo the edit changes if you really want to delete the folder.
(If you only have deletes pended on the children, you are still allowed to delete the parent folder, as this would not result in data loss.)
Simply use "Undo Checkout" from the workspace that has the files checked out.
You can also use the command line to perform a delete.
tf delete [/lock:(none|checkin|checkout)] [/recursive] [/login:username,[password]] itemspec
http://msdn.microsoft.com/en-us/library/k45zb450.aspx
Also, note that the items are not officially deleted until you perform a Check-in of the delete.
" The results of this command are not visible in other workspaces until you perform a check-in operation. For more information, see Check In Pending Changes."

Cleanup the files in TFS

We have added few folders/files in TFS which was deleted later. But, this folders are shown as deleted folders and it seems this can be recovered by performing undelete operation. These files should not have been checked-in in first place. How can I make sure this folders not available in TFS.
You can permanently delete the required version-controlled folders/files from Team Foundation Source control using the tf destroy command.
Check this MSDN library for detailed info on tf destroy command: http://msdn.microsoft.com/en-us/library/bb386005.aspx
You can't without directly editing the TFS database (which I really wouldn't recommend). TFS is a version control system; that includes control of deletions.
You could possibly set security on those specific items to deny anyone access to them, if it's important enough.

Resources